aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/method.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/abi/method.go')
-rw-r--r--accounts/abi/method.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/accounts/abi/method.go b/accounts/abi/method.go
index d8838e9ed..6b9aa011e 100644
--- a/accounts/abi/method.go
+++ b/accounts/abi/method.go
@@ -95,14 +95,15 @@ func (method Method) tupleUnpack(v interface{}, output []byte) error {
j := 0
for i := 0; i < len(method.Outputs); i++ {
toUnpack := method.Outputs[i]
- if toUnpack.Type.T == ArrayTy {
- // need to move this up because they read sequentially
- j += toUnpack.Type.Size
- }
marshalledValue, err := toGoType((i+j)*32, toUnpack.Type, output)
if err != nil {
return err
}
+ if toUnpack.Type.T == ArrayTy {
+ // combined index ('i' + 'j') need to be adjusted only by size of array, thus
+ // we need to decrement 'j' because 'i' was incremented
+ j += toUnpack.Type.Size - 1
+ }
reflectValue := reflect.ValueOf(marshalledValue)
switch value.Kind() {