@@ -165,8 +165,9 @@ func TestInvalidABI(t *testing.T) {
165
165
166
166
// TestConstructor tests a constructor function.
167
167
// The test is based on the following contract:
168
- // contract TestConstructor {
169
- // constructor(uint256 a, uint256 b) public{}
168
+ //
169
+ // contract TestConstructor {
170
+ // constructor(uint256 a, uint256 b) public{}
170
171
// }
171
172
func TestConstructor (t * testing.T ) {
172
173
json := `[{ "inputs": [{"internalType": "uint256","name": "a","type": "uint256" },{ "internalType": "uint256","name": "b","type": "uint256"}],"stateMutability": "nonpayable","type": "constructor"}]`
@@ -710,16 +711,19 @@ func TestBareEvents(t *testing.T) {
710
711
}
711
712
712
713
// TestUnpackEvent is based on this contract:
713
- // contract T {
714
- // event received(address sender, uint amount, bytes memo);
715
- // event receivedAddr(address sender);
716
- // function receive(bytes memo) external payable {
717
- // received(msg.sender, msg.value, memo);
718
- // receivedAddr(msg.sender);
719
- // }
720
- // }
714
+ //
715
+ // contract T {
716
+ // event received(address sender, uint amount, bytes memo);
717
+ // event receivedAddr(address sender);
718
+ // function receive(bytes memo) external payable {
719
+ // received(msg.sender, msg.value, memo);
720
+ // receivedAddr(msg.sender);
721
+ // }
722
+ // }
723
+ //
721
724
// When receive("X") is called with sender 0x00... and value 1, it produces this tx receipt:
722
- // receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
725
+ //
726
+ // receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
723
727
func TestUnpackEvent (t * testing.T ) {
724
728
const abiJSON = `[{"constant":false,"inputs":[{"name":"memo","type":"bytes"}],"name":"receive","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"memo","type":"bytes"}],"name":"received","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"}],"name":"receivedAddr","type":"event"}]`
725
729
abi , err := JSON (strings .NewReader (abiJSON ))
@@ -1066,8 +1070,9 @@ func TestDoubleDuplicateMethodNames(t *testing.T) {
1066
1070
// TestDoubleDuplicateEventNames checks that if send0 already exists, there won't be a name
1067
1071
// conflict and that the second send event will be renamed send1.
1068
1072
// The test runs the abi of the following contract.
1069
- // contract DuplicateEvent {
1070
- // event send(uint256 a);
1073
+ //
1074
+ // contract DuplicateEvent {
1075
+ // event send(uint256 a);
1071
1076
// event send0();
1072
1077
// event send();
1073
1078
// }
@@ -1094,7 +1099,8 @@ func TestDoubleDuplicateEventNames(t *testing.T) {
1094
1099
// TestUnnamedEventParam checks that an event with unnamed parameters is
1095
1100
// correctly handled.
1096
1101
// The test runs the abi of the following contract.
1097
- // contract TestEvent {
1102
+ //
1103
+ // contract TestEvent {
1098
1104
// event send(uint256, uint256);
1099
1105
// }
1100
1106
func TestUnnamedEventParam (t * testing.T ) {
0 commit comments