aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--accounts/abi/event_test.go12
-rw-r--r--accounts/abi/unpack.go2
-rw-r--r--accounts/abi/unpack_test.go5
3 files changed, 17 insertions, 2 deletions
diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go
index d966ad1db..34c7eebde 100644
--- a/accounts/abi/event_test.go
+++ b/accounts/abi/event_test.go
@@ -18,10 +18,10 @@ package abi
import (
"bytes"
- "reflect"
"encoding/hex"
"encoding/json"
"math/big"
+ "reflect"
"strings"
"testing"
@@ -180,6 +180,16 @@ func TestEventTupleUnpack(t *testing.T) {
"Can unpack Pledge event into slice",
}, {
pledgeData1,
+ &[3]interface{}{&common.Address{}, &bigint, &[3]byte{}},
+ &[3]interface{}{
+ &addr,
+ &bigintExpected2,
+ &[3]byte{'u', 's', 'd'}},
+ jsonEventPledge,
+ "",
+ "Can unpack Pledge event into an array",
+ }, {
+ pledgeData1,
&[]interface{}{new(int), 0, 0},
&[]interface{}{},
jsonEventPledge,
diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go
index 372a86c86..377aee874 100644
--- a/accounts/abi/unpack.go
+++ b/accounts/abi/unpack.go
@@ -202,4 +202,4 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err
//fmt.Printf("LENGTH PREFIX INFO: \nsize: %v\noffset: %v\nstart: %v\n", length, offset, start)
return
-} \ No newline at end of file
+}
diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go
index 89b3bce8c..391095073 100644
--- a/accounts/abi/unpack_test.go
+++ b/accounts/abi/unpack_test.go
@@ -337,6 +337,11 @@ func TestMethodMultiReturn(t *testing.T) {
"",
"Can unpack into a slice",
}, {
+ &[2]interface{}{&bigint, new(string)},
+ &[2]interface{}{&expected.Int, &expected.String},
+ "",
+ "Can unpack into an array",
+ }, {
&[]interface{}{new(int), new(int)},
&[]interface{}{&expected.Int, &expected.String},
"abi: cannot unmarshal *big.Int in to int",