@@ -67,10 +67,10 @@ func TestTypeCheck(t *testing.T) {
6767 {"uint16[3]" , [4 ]uint16 {1 , 2 , 3 }, "abi: cannot use [4]uint16 as type [3]uint16 as argument" },
6868 {"uint16[3]" , []uint16 {1 , 2 , 3 }, "" },
6969 {"uint16[3]" , []uint16 {1 , 2 , 3 , 4 }, "abi: cannot use [4]uint16 as type [3]uint16 as argument" },
70- {"address[]" , []common.Address {common. Address {1 }}, "" },
71- {"address[1]" , []common.Address {common. Address {1 }}, "" },
72- {"address[1]" , [1 ]common.Address {common. Address {1 }}, "" },
73- {"address[2]" , [1 ]common.Address {common. Address {1 }}, "abi: cannot use [1]array as type [2]array as argument" },
70+ {"address[]" , []common.Address {{1 }}, "" },
71+ {"address[1]" , []common.Address {{1 }}, "" },
72+ {"address[1]" , [1 ]common.Address {{1 }}, "" },
73+ {"address[2]" , [1 ]common.Address {{1 }}, "abi: cannot use [1]array as type [2]array as argument" },
7474 {"bytes32" , [32 ]byte {}, "" },
7575 {"bytes32" , [33 ]byte {}, "abi: cannot use [33]uint8 as type [32]uint8 as argument" },
7676 {"bytes32" , common.Hash {1 }, "" },
@@ -80,7 +80,7 @@ func TestTypeCheck(t *testing.T) {
8080 {"bytes" , [2 ]byte {0 , 1 }, "" },
8181 {"bytes" , common.Hash {1 }, "" },
8282 {"string" , "hello world" , "" },
83- {"bytes32[]" , [][32 ]byte {[ 32 ] byte {}}, "" },
83+ {"bytes32[]" , [][32 ]byte {{}}, "" },
8484 {"function" , [24 ]byte {}, "" },
8585 } {
8686 typ , err := NewType (test .typ )
@@ -343,8 +343,8 @@ func TestPack(t *testing.T) {
343343 {"uint16[]" , []uint16 {1 , 2 }, formatSliceOutput ([]byte {1 }, []byte {2 })},
344344 {"bytes20" , [20 ]byte {1 }, pad ([]byte {1 }, 32 , false )},
345345 {"uint256[]" , []* big.Int {big .NewInt (1 ), big .NewInt (2 )}, formatSliceOutput ([]byte {1 }, []byte {2 })},
346- {"address[]" , []common.Address {common. Address {1 }, common. Address {2 }}, formatSliceOutput (pad ([]byte {1 }, 20 , false ), pad ([]byte {2 }, 20 , false ))},
347- {"bytes32[]" , []common.Hash {common. Hash {1 }, common. Hash {2 }}, formatSliceOutput (pad ([]byte {1 }, 32 , false ), pad ([]byte {2 }, 32 , false ))},
346+ {"address[]" , []common.Address {{1 }, {2 }}, formatSliceOutput (pad ([]byte {1 }, 20 , false ), pad ([]byte {2 }, 20 , false ))},
347+ {"bytes32[]" , []common.Hash {{1 }, {2 }}, formatSliceOutput (pad ([]byte {1 }, 32 , false ), pad ([]byte {2 }, 32 , false ))},
348348 {"function" , [24 ]byte {1 }, pad ([]byte {1 }, 32 , false )},
349349 } {
350350 typ , err := NewType (test .typ )
@@ -458,12 +458,12 @@ func TestReader(t *testing.T) {
458458 Uint256 , _ := NewType ("uint256" )
459459 exp := ABI {
460460 Methods : map [string ]Method {
461- "balance" : Method {
461+ "balance" : {
462462 "balance" , true , nil , nil ,
463463 },
464- "send" : Method {
464+ "send" : {
465465 "send" , false , []Argument {
466- Argument {"amount" , Uint256 , false },
466+ {"amount" , Uint256 , false },
467467 }, nil ,
468468 },
469469 },
@@ -562,7 +562,7 @@ func TestTestSlice(t *testing.T) {
562562
563563func TestMethodSignature (t * testing.T ) {
564564 String , _ := NewType ("string" )
565- m := Method {"foo" , false , []Argument {Argument {"bar" , String , false }, Argument {"baz" , String , false }}, nil }
565+ m := Method {"foo" , false , []Argument {{"bar" , String , false }, {"baz" , String , false }}, nil }
566566 exp := "foo(string,string)"
567567 if m .Sig () != exp {
568568 t .Error ("signature mismatch" , exp , "!=" , m .Sig ())
@@ -574,7 +574,7 @@ func TestMethodSignature(t *testing.T) {
574574 }
575575
576576 uintt , _ := NewType ("uint" )
577- m = Method {"foo" , false , []Argument {Argument {"bar" , uintt , false }}, nil }
577+ m = Method {"foo" , false , []Argument {{"bar" , uintt , false }}, nil }
578578 exp = "foo(uint256)"
579579 if m .Sig () != exp {
580580 t .Error ("signature mismatch" , exp , "!=" , m .Sig ())
@@ -779,8 +779,8 @@ func TestBareEvents(t *testing.T) {
779779 "balance" : {false , nil },
780780 "anon" : {true , nil },
781781 "args" : {false , []Argument {
782- Argument {Name : "arg0" , Type : arg0 , Indexed : false },
783- Argument {Name : "arg1" , Type : arg1 , Indexed : true },
782+ {Name : "arg0" , Type : arg0 , Indexed : false },
783+ {Name : "arg1" , Type : arg1 , Indexed : true },
784784 }},
785785 }
786786
0 commit comments