diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index ca19c5801cb7..61ab70eb83ad 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -927,7 +927,7 @@ func TestABI_MethodById(t *testing.T) { } b := fmt.Sprintf("%v", m2) if a != b { - t.Errorf("Method %v (id %v) not 'findable' by id in ABI", name, common.ToHex(m.ID())) + t.Errorf("Method %v (id %x) not 'findable' by id in ABI", name, m.ID()) } } // Also test empty diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index 792e26762e89..090b9217dbdd 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -173,7 +173,7 @@ func TestEventTupleUnpack(t *testing.T) { type EventTransferWithTag struct { // this is valid because `value` is not exportable, // so value is only unmarshalled into `Value1`. - value *big.Int + value *big.Int //lint:ignore U1000 unused field is part of test Value1 *big.Int `abi:"value"` } @@ -354,40 +354,6 @@ func unpackTestEventData(dest interface{}, hexData string, jsonEvent []byte, ass return a.Unpack(dest, "e", data) } -/* -Taken from -https://github.com/ethereum/go-ethereum/pull/15568 -*/ - -type testResult struct { - Values [2]*big.Int - Value1 *big.Int - Value2 *big.Int -} - -type testCase struct { - definition string - want testResult -} - -func (tc testCase) encoded(intType, arrayType Type) []byte { - var b bytes.Buffer - if tc.want.Value1 != nil { - val, _ := intType.pack(reflect.ValueOf(tc.want.Value1)) - b.Write(val) - } - - if !reflect.DeepEqual(tc.want.Values, [2]*big.Int{nil, nil}) { - val, _ := arrayType.pack(reflect.ValueOf(tc.want.Values)) - b.Write(val) - } - if tc.want.Value2 != nil { - val, _ := intType.pack(reflect.ValueOf(tc.want.Value2)) - b.Write(val) - } - return b.Bytes() -} - // TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder. func TestEventUnpackIndexed(t *testing.T) { definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]`