@@ -67,10 +67,10 @@ func TestTypeCheck(t *testing.T) {
67
67
{"uint16[3]" , [4 ]uint16 {1 , 2 , 3 }, "abi: cannot use [4]uint16 as type [3]uint16 as argument" },
68
68
{"uint16[3]" , []uint16 {1 , 2 , 3 }, "" },
69
69
{"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" },
74
74
{"bytes32" , [32 ]byte {}, "" },
75
75
{"bytes32" , [33 ]byte {}, "abi: cannot use [33]uint8 as type [32]uint8 as argument" },
76
76
{"bytes32" , common.Hash {1 }, "" },
@@ -80,7 +80,7 @@ func TestTypeCheck(t *testing.T) {
80
80
{"bytes" , [2 ]byte {0 , 1 }, "" },
81
81
{"bytes" , common.Hash {1 }, "" },
82
82
{"string" , "hello world" , "" },
83
- {"bytes32[]" , [][32 ]byte {[ 32 ] byte {}}, "" },
83
+ {"bytes32[]" , [][32 ]byte {{}}, "" },
84
84
{"function" , [24 ]byte {}, "" },
85
85
} {
86
86
typ , err := NewType (test .typ )
@@ -343,8 +343,8 @@ func TestPack(t *testing.T) {
343
343
{"uint16[]" , []uint16 {1 , 2 }, formatSliceOutput ([]byte {1 }, []byte {2 })},
344
344
{"bytes20" , [20 ]byte {1 }, pad ([]byte {1 }, 32 , false )},
345
345
{"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 ))},
348
348
{"function" , [24 ]byte {1 }, pad ([]byte {1 }, 32 , false )},
349
349
} {
350
350
typ , err := NewType (test .typ )
@@ -458,12 +458,12 @@ func TestReader(t *testing.T) {
458
458
Uint256 , _ := NewType ("uint256" )
459
459
exp := ABI {
460
460
Methods : map [string ]Method {
461
- "balance" : Method {
461
+ "balance" : {
462
462
"balance" , true , nil , nil ,
463
463
},
464
- "send" : Method {
464
+ "send" : {
465
465
"send" , false , []Argument {
466
- Argument {"amount" , Uint256 , false },
466
+ {"amount" , Uint256 , false },
467
467
}, nil ,
468
468
},
469
469
},
@@ -562,7 +562,7 @@ func TestTestSlice(t *testing.T) {
562
562
563
563
func TestMethodSignature (t * testing.T ) {
564
564
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 }
566
566
exp := "foo(string,string)"
567
567
if m .Sig () != exp {
568
568
t .Error ("signature mismatch" , exp , "!=" , m .Sig ())
@@ -574,7 +574,7 @@ func TestMethodSignature(t *testing.T) {
574
574
}
575
575
576
576
uintt , _ := NewType ("uint" )
577
- m = Method {"foo" , false , []Argument {Argument {"bar" , uintt , false }}, nil }
577
+ m = Method {"foo" , false , []Argument {{"bar" , uintt , false }}, nil }
578
578
exp = "foo(uint256)"
579
579
if m .Sig () != exp {
580
580
t .Error ("signature mismatch" , exp , "!=" , m .Sig ())
@@ -779,8 +779,8 @@ func TestBareEvents(t *testing.T) {
779
779
"balance" : {false , nil },
780
780
"anon" : {true , nil },
781
781
"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 },
784
784
}},
785
785
}
786
786
0 commit comments