diff --git a/accounts/abi/error.go b/accounts/abi/error.go index cf12c45edb..420acf4182 100644 --- a/accounts/abi/error.go +++ b/accounts/abi/error.go @@ -23,7 +23,7 @@ import ( ) var ( - errBadBool error = errors.New("abi: improperly encoded boolean value") + errBadBool = errors.New("abi: improperly encoded boolean value") ) // formatSliceString formats the reflection kind with the given slice size diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index a33754ccc0..8e3afee4e6 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -196,7 +196,7 @@ func TestSimpleMethodUnpack(t *testing.T) { case "hash": var v common.Hash err = abi.Unpack(&v, "method", test.marshalledOutput) - outvar = v + outvar = v.Bytes()[:] case "function": var v [24]byte err = abi.Unpack(&v, "method", test.marshalledOutput) @@ -222,12 +222,6 @@ func TestSimpleMethodUnpack(t *testing.T) { } if err == nil { - // bit of an ugly hack for hash type but I don't feel like finding a proper solution - if test.outVar == "hash" { - tmp := outvar.(common.Hash) // without assignment it's unaddressable - outvar = tmp[:] - } - if !reflect.DeepEqual(test.expectedOut, outvar) { t.Errorf("%d failed. Output error: expected %v, got %v", i, test.expectedOut, outvar) }