diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-05-11 19:21:25 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-05-12 23:19:29 +0800 |
commit | 2e6b9c141bf2b7e0c555dfeaad2147cf96b08974 (patch) | |
tree | a9304a133778fa28b47b702aa1831896dcd36385 /accounts/abi/bind/bind_test.go | |
parent | b38cea665400c8a119a6e859ea3c13f1f7234a69 (diff) | |
download | go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar.gz go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar.bz2 go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar.lz go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar.xz go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.tar.zst go-tangerine-2e6b9c141bf2b7e0c555dfeaad2147cf96b08974.zip |
[release/1.4.4] accounts/abi: fixed unpacking in to already slice interfaces
Previously it was assumed that wheneven type `[]interface{}` was given
that the interface was empty. The abigen rightfully assumed that
interface slices which already have pre-allocated variable sets to be
assigned.
This PR fixes that by checking that the given `[]interface{}` is larger
than zero and assigns each value using the generic `set` function (this
function has also been moved to abi/reflect.go) and checks whether the
assignment was possible.
The generic assignment function `set` now also deals with pointers
(useful for interface slice mentioned above) by dereferencing the
pointer until it finds a setable type.
(cherry picked from commit 91a7a4a7867718ccb6c9620120a1be5680ad0abd)
Diffstat (limited to 'accounts/abi/bind/bind_test.go')
0 files changed, 0 insertions, 0 deletions