accounts/abi: allow interface as the destination (#18490)
This commit is contained in:
committed by
Guillaume Ballet
parent
ad849c01d3
commit
a50b471b6b
@ -512,6 +512,11 @@ func TestMethodMultiReturn(t *testing.T) {
|
||||
Int *big.Int
|
||||
}
|
||||
|
||||
newInterfaceSlice := func(len int) interface{} {
|
||||
slice := make([]interface{}, len)
|
||||
return &slice
|
||||
}
|
||||
|
||||
abi, data, expected := methodMultiReturn(require.New(t))
|
||||
bigint := new(big.Int)
|
||||
var testCases = []struct {
|
||||
@ -539,6 +544,16 @@ func TestMethodMultiReturn(t *testing.T) {
|
||||
&[2]interface{}{&expected.Int, &expected.String},
|
||||
"",
|
||||
"Can unpack into an array",
|
||||
}, {
|
||||
&[2]interface{}{},
|
||||
&[2]interface{}{expected.Int, expected.String},
|
||||
"",
|
||||
"Can unpack into interface array",
|
||||
}, {
|
||||
newInterfaceSlice(2),
|
||||
&[]interface{}{expected.Int, expected.String},
|
||||
"",
|
||||
"Can unpack into interface slice",
|
||||
}, {
|
||||
&[]interface{}{new(int), new(int)},
|
||||
&[]interface{}{&expected.Int, &expected.String},
|
||||
|
Reference in New Issue
Block a user