diff options
Diffstat (limited to 'accounts/abi/abi.go')
-rw-r--r-- | accounts/abi/abi.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index cbcf4ca92..254b1f7fb 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -97,7 +97,6 @@ func (abi *ABI) UnmarshalJSON(data []byte) error { Type string Name string Constant bool - Indexed bool Anonymous bool Inputs []Argument Outputs []Argument @@ -137,11 +136,11 @@ func (abi *ABI) UnmarshalJSON(data []byte) error { // MethodById looks up a method by the 4-byte id // returns nil if none found -func (abi *ABI) MethodById(sigdata []byte) *Method { +func (abi *ABI) MethodById(sigdata []byte) (*Method, error) { for _, method := range abi.Methods { if bytes.Equal(method.Id(), sigdata[:4]) { - return &method + return &method, nil } } - return nil + return nil, fmt.Errorf("no method with id: %#x", sigdata[:4]) } |