1313//
1414// You should have received a copy of the GNU Lesser General Public License
1515// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
16+ //
1617//nolint:scopelint
1718package abi
1819
@@ -165,8 +166,9 @@ func TestInvalidABI(t *testing.T) {
165166
166167// TestConstructor tests a constructor function.
167168// The test is based on the following contract:
168- // contract TestConstructor {
169- // constructor(uint256 a, uint256 b) public{}
169+ //
170+ // contract TestConstructor {
171+ // constructor(uint256 a, uint256 b) public{}
170172// }
171173func TestConstructor (t * testing.T ) {
172174 json := `[{ "inputs": [{"internalType": "uint256","name": "a","type": "uint256" },{ "internalType": "uint256","name": "b","type": "uint256"}],"stateMutability": "nonpayable","type": "constructor"}]`
@@ -710,16 +712,19 @@ func TestBareEvents(t *testing.T) {
710712}
711713
712714// 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- // }
715+ //
716+ // contract T {
717+ // event received(address sender, uint amount, bytes memo);
718+ // event receivedAddr(address sender);
719+ // function receive(bytes memo) external payable {
720+ // received(msg.sender, msg.value, memo);
721+ // receivedAddr(msg.sender);
722+ // }
723+ // }
724+ //
721725// 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]}
726+ //
727+ // receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
723728func TestUnpackEvent (t * testing.T ) {
724729 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"}]`
725730 abi , err := JSON (strings .NewReader (abiJSON ))
@@ -1064,8 +1069,9 @@ func TestDoubleDuplicateMethodNames(t *testing.T) {
10641069// TestDoubleDuplicateEventNames checks that if send0 already exists, there won't be a name
10651070// conflict and that the second send event will be renamed send1.
10661071// The test runs the abi of the following contract.
1067- // contract DuplicateEvent {
1068- // event send(uint256 a);
1072+ //
1073+ // contract DuplicateEvent {
1074+ // event send(uint256 a);
10691075// event send0();
10701076// event send();
10711077// }
@@ -1092,7 +1098,8 @@ func TestDoubleDuplicateEventNames(t *testing.T) {
10921098// TestUnnamedEventParam checks that an event with unnamed parameters is
10931099// correctly handled.
10941100// The test runs the abi of the following contract.
1095- // contract TestEvent {
1101+ //
1102+ // contract TestEvent {
10961103// event send(uint256, uint256);
10971104// }
10981105func TestUnnamedEventParam (t * testing.T ) {
0 commit comments