diff options
Diffstat (limited to 'accounts/abi/abi_test.go')
-rw-r--r-- | accounts/abi/abi_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index 8018df775..59ba79cb6 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -711,5 +711,14 @@ func TestABI_MethodById(t *testing.T) { t.Errorf("Method %v (id %v) not 'findable' by id in ABI", name, common.ToHex(m.Id())) } } - + // Also test empty + if _, err := abi.MethodById([]byte{0x00}); err == nil { + t.Errorf("Expected error, too short to decode data") + } + if _, err := abi.MethodById([]byte{}); err == nil { + t.Errorf("Expected error, too short to decode data") + } + if _, err := abi.MethodById(nil); err == nil { + t.Errorf("Expected error, nil is short to decode data") + } } |