mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-08 17:21:47 +00:00
accounts/abi: fix for one output interface crashing
This commit is contained in:
parent
f7ca03ae87
commit
e7cd627d93
1 changed files with 10 additions and 0 deletions
|
|
@ -169,6 +169,16 @@ func (arguments Arguments) unpackAtomic(v interface{}, output []byte) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we reach this part, there is only one output member from the contract event.
|
||||||
|
// for mobile, the result type is always a slice.
|
||||||
|
if reflect.Slice == value.Kind() && value.Len() >= 1 {
|
||||||
|
//check if it's not a byte slice
|
||||||
|
if reflect.TypeOf([]byte{}) != value.Type() {
|
||||||
|
value = value.Index(0).Elem()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return set(value, reflect.ValueOf(marshalledValue), arg)
|
return set(value, reflect.ValueOf(marshalledValue), arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue