accounts/abi/bind: Refactored topics (#20851)

* accounts/abi/bind: refactored topics

* accounts/abi/bind: use store function to remove code duplication

* accounts/abi/bind: removed unused type defs

* accounts/abi/bind: error on tuples in topics

* Cosmetic changes to restart travis build

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
This commit is contained in:
Marius van der Wijden
2020-04-08 12:00:10 +02:00
committed by GitHub
parent 6975172d01
commit 5065cdefff
4 changed files with 55 additions and 128 deletions

View File

@ -84,6 +84,7 @@ func setupTopicsTests() []topicTest {
bytesType, _ := abi.NewType("bytes5", "", nil)
int8Type, _ := abi.NewType("int8", "", nil)
int256Type, _ := abi.NewType("int256", "", nil)
tupleType, _ := abi.NewType("tuple(int256,int8)", "", nil)
tests := []topicTest{
{
@ -145,6 +146,21 @@ func setupTopicsTests() []topicTest {
},
wantErr: false,
},
{
name: "tuple(int256, int8)",
args: args{
createObj: func() interface{} { return nil },
resultObj: func() interface{} { return nil },
resultMap: func() map[string]interface{} { return make(map[string]interface{}) },
fields: abi.Arguments{abi.Argument{
Name: "tupletype",
Type: tupleType,
Indexed: true,
}},
topics: []common.Hash{},
},
wantErr: true,
},
}
return tests