diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-04-21 03:25:19 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-04-28 18:41:42 +0800 |
commit | c3d5250473794e5b7732e0d06941a6736cff2fca (patch) | |
tree | 453048c29297295260c698b330c804c7cdd7c78c /accounts/abi/abi_test.go | |
parent | e0dc45fce2276fcabae8dca61dc766f98dde23e2 (diff) | |
download | go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar.gz go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar.bz2 go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar.lz go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar.xz go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.tar.zst go-tangerine-c3d5250473794e5b7732e0d06941a6736cff2fca.zip |
accounts/abi: added unpacking "anything" in to interface{}
Diffstat (limited to 'accounts/abi/abi_test.go')
-rw-r--r-- | accounts/abi/abi_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index 249d37dca..4b41d2eee 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -161,6 +161,13 @@ func TestSimpleMethodUnpack(t *testing.T) { "hash", nil, }, + { + `[ { "type": "bytes32" } ]`, + pad([]byte{1}, 32, false), + pad([]byte{1}, 32, false), + "interface", + nil, + }, } { abiDefinition := fmt.Sprintf(`[{ "name" : "method", "outputs": %s}]`, test.def) abi, err := JSON(strings.NewReader(abiDefinition)) @@ -203,6 +210,8 @@ func TestSimpleMethodUnpack(t *testing.T) { var v common.Hash err = abi.Unpack(&v, "method", test.marshalledOutput) outvar = v + case "interface": + err = abi.Unpack(&outvar, "method", test.marshalledOutput) default: t.Errorf("unsupported type '%v' please add it to the switch statement in this test", test.outVar) continue |