Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit c1df065

Browse files
authored
fix rpc hex unmarshaling (#529)
1 parent a54c2dc commit c1df065

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tests/rpc_test.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func TestEth_GetLogs_Topics_AB(t *testing.T) {
226226
func TestEth_GetTransactionCount(t *testing.T) {
227227
// TODO: this test passes on when run on its own, but fails when run with the other tests
228228
if testing.Short() {
229-
t.Skip("skipping TestEth_GetLogs_Topics_AB")
229+
t.Skip("skipping TestEth_GetTransactionCount")
230230
}
231231

232232
prev := getNonce(t)
@@ -238,7 +238,7 @@ func TestEth_GetTransactionCount(t *testing.T) {
238238
func TestEth_GetTransactionLogs(t *testing.T) {
239239
// TODO: this test passes on when run on its own, but fails when run with the other tests
240240
if testing.Short() {
241-
t.Skip("skipping TestEth_GetLogs_Topics_AB")
241+
t.Skip("skipping TestEth_GetTransactionLogs")
242242
}
243243

244244
hash, _ := deployTestContract(t)
@@ -569,15 +569,15 @@ func TestEth_GetFilterChanges_NoTopics(t *testing.T) {
569569
// instantiate new filter
570570
rpcRes = call(t, "eth_newFilter", param)
571571
require.Nil(t, rpcRes.Error)
572-
var ID hexutil.Bytes
572+
var ID string
573573
err = json.Unmarshal(rpcRes.Result, &ID)
574574
require.NoError(t, err)
575575

576576
// deploy contract, emitting some event
577577
deployTestContract(t)
578578

579579
// get filter changes
580-
changesRes := call(t, "eth_getFilterChanges", []string{ID.String()})
580+
changesRes := call(t, "eth_getFilterChanges", []string{ID})
581581

582582
var logs []*ethtypes.Log
583583
err = json.Unmarshal(changesRes.Result, &logs)
@@ -688,14 +688,14 @@ func TestEth_GetFilterChanges_Topics_XB(t *testing.T) {
688688

689689
// instantiate new filter
690690
rpcRes = call(t, "eth_newFilter", param)
691-
var ID hexutil.Bytes
691+
var ID string
692692
err = json.Unmarshal(rpcRes.Result, &ID)
693693
require.NoError(t, err)
694694

695695
deployTestContractWithFunction(t)
696696

697697
// get filter changes
698-
changesRes := call(t, "eth_getFilterChanges", []string{ID.String()})
698+
changesRes := call(t, "eth_getFilterChanges", []string{ID})
699699

700700
var logs []*ethtypes.Log
701701
err = json.Unmarshal(changesRes.Result, &logs)
@@ -712,10 +712,9 @@ func TestEth_GetFilterChanges_Topics_XXC(t *testing.T) {
712712
func TestEth_PendingTransactionFilter(t *testing.T) {
713713
rpcRes := call(t, "eth_newPendingTransactionFilter", []string{})
714714

715-
var code hexutil.Bytes
716-
err := code.UnmarshalJSON(rpcRes.Result)
715+
var ID string
716+
err := json.Unmarshal(rpcRes.Result, &ID)
717717
require.NoError(t, err)
718-
require.NotNil(t, code)
719718

720719
for i := 0; i < 5; i++ {
721720
deployTestContractWithFunction(t)
@@ -724,7 +723,7 @@ func TestEth_PendingTransactionFilter(t *testing.T) {
724723
time.Sleep(10 * time.Second)
725724

726725
// get filter changes
727-
changesRes := call(t, "eth_getFilterChanges", []string{code.String()})
726+
changesRes := call(t, "eth_getFilterChanges", []string{ID})
728727
require.NotNil(t, changesRes)
729728

730729
var txs []*hexutil.Bytes

0 commit comments

Comments
 (0)