mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
Merge cf40142f31 into 9dbb8ef4aa
This commit is contained in:
commit
8edbda8399
2 changed files with 20 additions and 0 deletions
|
|
@ -132,6 +132,16 @@ func (e Event) singleUnpack(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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := set(value, reflect.ValueOf(marshalledValue), e.Inputs[0]); err != nil {
|
if err := set(value, reflect.ValueOf(marshalledValue), e.Inputs[0]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,16 @@ func (method Method) singleUnpack(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 method.
|
||||||
|
// 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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := set(value, reflect.ValueOf(marshalledValue), method.Outputs[0]); err != nil {
|
if err := set(value, reflect.ValueOf(marshalledValue), method.Outputs[0]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue