From c3d5250473794e5b7732e0d06941a6736cff2fca Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Wed, 20 Apr 2016 21:25:19 +0200 Subject: accounts/abi: added unpacking "anything" in to interface{} --- accounts/abi/abi_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'accounts/abi/abi_test.go') 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 -- cgit