diff options
author | Dmitry Shulyak <yashulyak@gmail.com> | 2017-12-20 22:09:23 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-12-20 22:09:23 +0800 |
commit | da58afcea0525fab2d3f45f58e7e243a15407ab9 (patch) | |
tree | aa93996ead74ae3356b90214ee706f5a00cdb888 /accounts/abi/event.go | |
parent | ce823c9f84a3ab46003d1167ee54ab59b01092d6 (diff) | |
download | go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar.gz go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar.bz2 go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar.lz go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar.xz go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.tar.zst go-tangerine-da58afcea0525fab2d3f45f58e7e243a15407ab9.zip |
accounts/abi: update array length after parsing array (#15618)
Fixes #15617
Diffstat (limited to 'accounts/abi/event.go')
-rw-r--r-- | accounts/abi/event.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/accounts/abi/event.go b/accounts/abi/event.go index 44ed7b8df..bd1098d87 100644 --- a/accounts/abi/event.go +++ b/accounts/abi/event.go @@ -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() { |