mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Merge 1c0116ae6c into d2fda73ad7
This commit is contained in:
commit
e570761d41
1 changed files with 8 additions and 1 deletions
|
|
@ -304,12 +304,19 @@ func (abi ABI) Unpack(v interface{}, name string, output []byte) error {
|
|||
// struct will match named return values to the struct's field
|
||||
// names
|
||||
case reflect.Struct:
|
||||
idx := 0
|
||||
for i := 0; i < len(method.Outputs); i++ {
|
||||
marshalledValue, err := toGoType(i, method.Outputs[i], output)
|
||||
marshalledValue, err := toGoType(idx, method.Outputs[i], output)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reflectValue := reflect.ValueOf(marshalledValue)
|
||||
switch reflectValue.Type().Kind() {
|
||||
case reflect.Slice, reflect.Array:
|
||||
idx += reflectValue.Len()
|
||||
default:
|
||||
idx++
|
||||
}
|
||||
|
||||
for j := 0; j < typ.NumField(); j++ {
|
||||
field := typ.Field(j)
|
||||
|
|
|
|||
Loading…
Reference in a new issue