@@ -93,17 +93,17 @@ func TestSimulatedBackend(t *testing.T) {
93
93
94
94
var testKey , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
95
95
96
- // the following is based on this contract:
97
- // contract T {
98
- // event received(address sender, uint amount, bytes memo);
99
- // event receivedAddr(address sender);
96
+ // the following is based on this contract:
97
+ // contract T {
98
+ // event received(address sender, uint amount, bytes memo);
99
+ // event receivedAddr(address sender);
100
100
//
101
- // function receive(bytes calldata memo) external payable returns (string memory res) {
102
- // emit received(msg.sender, msg.value, memo);
103
- // emit receivedAddr(msg.sender);
104
- // return "hello world";
105
- // }
106
- // }
101
+ // function receive(bytes calldata memo) external payable returns (string memory res) {
102
+ // emit received(msg.sender, msg.value, memo);
103
+ // emit receivedAddr(msg.sender);
104
+ // return "hello world";
105
+ // }
106
+ // }
107
107
const abiJSON = `[ { "constant": false, "inputs": [ { "name": "memo", "type": "bytes" } ], "name": "receive", "outputs": [ { "name": "res", "type": "string" } ], "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" } ]`
108
108
const abiBin = `0x608060405234801561001057600080fd5b506102a0806100206000396000f3fe60806040526004361061003b576000357c010000000000000000000000000000000000000000000000000000000090048063a69b6ed014610040575b600080fd5b6100b76004803603602081101561005657600080fd5b810190808035906020019064010000000081111561007357600080fd5b82018360208201111561008557600080fd5b803590602001918460018302840111640100000000831117156100a757600080fd5b9091929391929390505050610132565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f75780820151818401526020810190506100dc565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60607f75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed33348585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060405180910390a17f46923992397eac56cf13058aced2a1871933622717e27b24eabc13bf9dd329c833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16040805190810160405280600b81526020017f68656c6c6f20776f726c6400000000000000000000000000000000000000000081525090509291505056fea165627a7a72305820ff0c57dad254cfeda48c9cfb47f1353a558bccb4d1bc31da1dae69315772d29e0029`
109
109
const deployedCode = `60806040526004361061003b576000357c010000000000000000000000000000000000000000000000000000000090048063a69b6ed014610040575b600080fd5b6100b76004803603602081101561005657600080fd5b810190808035906020019064010000000081111561007357600080fd5b82018360208201111561008557600080fd5b803590602001918460018302840111640100000000831117156100a757600080fd5b9091929391929390505050610132565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f75780820151818401526020810190506100dc565b50505050905090810190601f1680156101245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60607f75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed33348585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060405180910390a17f46923992397eac56cf13058aced2a1871933622717e27b24eabc13bf9dd329c833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16040805190810160405280600b81526020017f68656c6c6f20776f726c6400000000000000000000000000000000000000000081525090509291505056fea165627a7a72305820ff0c57dad254cfeda48c9cfb47f1353a558bccb4d1bc31da1dae69315772d29e0029`
@@ -1015,8 +1015,7 @@ func TestCodeAt(t *testing.T) {
1015
1015
}
1016
1016
1017
1017
// When receive("X") is called with sender 0x00... and value 1, it produces this tx receipt:
1018
- //
1019
- // receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
1018
+ // receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
1020
1019
func TestPendingAndCallContract (t * testing.T ) {
1021
1020
testAddr := crypto .PubkeyToAddress (testKey .PublicKey )
1022
1021
sim := simTestBackend (testAddr )
@@ -1227,11 +1226,10 @@ func TestFork(t *testing.T) {
1227
1226
Example contract to test event emission:
1228
1227
1229
1228
pragma solidity >=0.7.0 <0.9.0;
1230
-
1231
- contract Callable {
1232
- event Called();
1233
- function Call() public { emit Called(); }
1234
- }
1229
+ contract Callable {
1230
+ event Called();
1231
+ function Call() public { emit Called(); }
1232
+ }
1235
1233
*/
1236
1234
const callableAbi = "[{\" anonymous\" :false,\" inputs\" :[],\" name\" :\" Called\" ,\" type\" :\" event\" },{\" inputs\" :[],\" name\" :\" Call\" ,\" outputs\" :[],\" stateMutability\" :\" nonpayable\" ,\" type\" :\" function\" }]"
1237
1235
@@ -1249,7 +1247,6 @@ const callableBin = "6080604052348015600f57600080fd5b5060998061001e6000396000f3f
1249
1247
// 7. Mine two blocks to trigger a reorg.
1250
1248
// 8. Check that the event was removed.
1251
1249
// 9. Re-send the transaction and mine a block.
1252
- //
1253
1250
// 10. Check that the event was reborn.
1254
1251
func TestForkLogsReborn (t * testing.T ) {
1255
1252
testAddr := crypto .PubkeyToAddress (testKey .PublicKey )
0 commit comments