accounts/abi: update array length after parsing array (#15618)

Fixes #15617
This commit is contained in:
Dmitry Shulyak
2017-12-20 16:09:23 +02:00
committed by Felix Lange
parent ce823c9f84
commit da58afcea0
4 changed files with 78 additions and 26 deletions

View File

@ -71,14 +71,16 @@ func (e Event) tupleUnpack(v interface{}, output []byte) error {
if input.Indexed {
// can't read, continue
continue
} else if input.Type.T == ArrayTy {
// need to move this up because they read sequentially
j += input.Type.Size
}
marshalledValue, err := toGoType((i+j)*32, input.Type, output)
if err != nil {
return err
}
if input.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 += input.Type.Size - 1
}
reflectValue := reflect.ValueOf(marshalledValue)
switch value.Kind() {