accounts/abi: Deduplicate code in unpacker
This commit is contained in:
@ -136,7 +136,7 @@ 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, error){
|
||||
func (abi *ABI) MethodById(sigdata []byte) (*Method, error) {
|
||||
for _, method := range abi.Methods {
|
||||
if bytes.Equal(method.Id(), sigdata[:4]) {
|
||||
return &method, nil
|
||||
|
Reference in New Issue
Block a user