Skip to content

Commit

Permalink
rpcsrv/tests: simplify tests with parsed test contract hash
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Nov 22, 2024
1 parent efecabf commit 29d2a57
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 64 deletions.
10 changes: 5 additions & 5 deletions pkg/services/rpcsrv/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestClient_NEP17(t *testing.T) {
t.Cleanup(c.Close)
require.NoError(t, c.Init())

h, err := util.Uint160DecodeStringLE(testContractHash)
h, err := util.Uint160DecodeStringLE(testContractHashLE)
require.NoError(t, err)
rub := nep17.NewReader(invoker.New(c, nil), h)

Expand Down Expand Up @@ -295,7 +295,7 @@ func TestClientManagementContract(t *testing.T) {
ids, err := manReader.GetContractHashesExpanded(10)
require.NoError(t, err)
ctrs := make([]management.IDHash, 0)
for i, s := range []string{testContractHash, verifyContractHash, verifyWithArgsContractHash, nnsContractHash, nfsoContractHash, storageContractHash} {
for i, s := range []string{testContractHashLE, verifyContractHash, verifyWithArgsContractHash, nnsContractHash, nfsoContractHash, storageContractHash} {
h, err := util.Uint160DecodeStringLE(s)
require.NoError(t, err)
ctrs = append(ctrs, management.IDHash{ID: int32(i) + 1, Hash: h})
Expand Down Expand Up @@ -2288,7 +2288,7 @@ func TestClient_FindStorage(t *testing.T) {
t.Cleanup(c.Close)
require.NoError(t, c.Init())

h, err := util.Uint160DecodeStringLE(testContractHash)
h, err := util.Uint160DecodeStringLE(testContractHashLE)
require.NoError(t, err)
prefix := []byte("aa")
expected := result.FindStorage{
Expand Down Expand Up @@ -2355,7 +2355,7 @@ func TestClient_FindStorageHistoric(t *testing.T) {

root, err := util.Uint256DecodeStringLE(block20StateRootLE)
require.NoError(t, err)
h, err := util.Uint160DecodeStringLE(testContractHash)
h, err := util.Uint160DecodeStringLE(testContractHashLE)
require.NoError(t, err)
prefix := []byte("aa")
expected := result.FindStorage{
Expand Down Expand Up @@ -2424,7 +2424,7 @@ func TestClient_GetStorageHistoric(t *testing.T) {

root, err := util.Uint256DecodeStringLE(block20StateRootLE)
require.NoError(t, err)
h, err := util.Uint160DecodeStringLE(testContractHash)
h, err := util.Uint160DecodeStringLE(testContractHashLE)
require.NoError(t, err)
key := []byte("aa10")
expected := []byte("v2")
Expand Down
Loading

0 comments on commit 29d2a57

Please sign in to comment.