|
|
@ -78,7 +78,7 @@ func (arguments Arguments) isTuple() bool { |
|
|
|
// Unpack performs the operation hexdata -> Go format.
|
|
|
|
// Unpack performs the operation hexdata -> Go format.
|
|
|
|
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) { |
|
|
|
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) { |
|
|
|
if len(data) == 0 { |
|
|
|
if len(data) == 0 { |
|
|
|
if len(arguments) != 0 { |
|
|
|
if len(arguments.NonIndexed()) != 0 { |
|
|
|
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected") |
|
|
|
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected") |
|
|
|
} |
|
|
|
} |
|
|
|
return make([]interface{}, 0), nil |
|
|
|
return make([]interface{}, 0), nil |
|
|
@ -93,7 +93,7 @@ func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) |
|
|
|
return fmt.Errorf("abi: cannot unpack into a nil map") |
|
|
|
return fmt.Errorf("abi: cannot unpack into a nil map") |
|
|
|
} |
|
|
|
} |
|
|
|
if len(data) == 0 { |
|
|
|
if len(data) == 0 { |
|
|
|
if len(arguments) != 0 { |
|
|
|
if len(arguments.NonIndexed()) != 0 { |
|
|
|
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected") |
|
|
|
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected") |
|
|
|
} |
|
|
|
} |
|
|
|
return nil // Nothing to unmarshal, return
|
|
|
|
return nil // Nothing to unmarshal, return
|
|
|
@ -115,8 +115,8 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error { |
|
|
|
return fmt.Errorf("abi: Unpack(non-pointer %T)", v) |
|
|
|
return fmt.Errorf("abi: Unpack(non-pointer %T)", v) |
|
|
|
} |
|
|
|
} |
|
|
|
if len(values) == 0 { |
|
|
|
if len(values) == 0 { |
|
|
|
if len(arguments) != 0 { |
|
|
|
if len(arguments.NonIndexed()) != 0 { |
|
|
|
return fmt.Errorf("abi: attempting to copy no values while %d arguments are expected", len(arguments)) |
|
|
|
return fmt.Errorf("abi: attempting to copy no values while arguments are expected") |
|
|
|
} |
|
|
|
} |
|
|
|
return nil // Nothing to copy, return
|
|
|
|
return nil // Nothing to copy, return
|
|
|
|
} |
|
|
|
} |
|
|
|