|
49 | 49 | function getKeccakOfEmptyString() public view returns (bytes32 variant) { |
50 | 50 | variant = keccak256(emprty_string); |
51 | 51 | } |
52 | | - |
| 52 | +
|
53 | 53 | bytes32 constant neonlabsHash = keccak256("neonlabs"); |
54 | 54 |
|
55 | 55 | function endlessCycle() public view returns (bytes32 variant) { |
|
61 | 61 | } |
62 | 62 |
|
63 | 63 | bytes32 public value = ""; |
64 | | - |
| 64 | +
|
65 | 65 | function initValue(string memory s) public { |
66 | 66 | value = keccak256(bytes(s)); |
67 | 67 | } |
|
71 | 71 | value = keccak256(abi.encodePacked(value)); |
72 | 72 | } |
73 | 73 | } |
74 | | - |
| 74 | +
|
75 | 75 | function getValue() public view returns (bytes32) { |
76 | 76 | return value; |
77 | 77 | } |
78 | | - |
| 78 | +
|
79 | 79 | } |
80 | 80 | ''' |
81 | 81 |
|
@@ -210,16 +210,55 @@ def test_04_execute_with_bad_nonce(self): |
210 | 210 | # @unittest.skip("a.i.") |
211 | 211 | def test_05_transfer_one_gwei(self): |
212 | 212 | print("\ntest_05_transfer_one_gwei") |
| 213 | + |
| 214 | + one_gwei = 1_000_000_000 |
| 215 | + |
213 | 216 | eth_account_alice = proxy.eth.account.create('alice') |
214 | 217 | eth_account_bob = proxy.eth.account.create('bob') |
215 | 218 | print('eth_account_alice.address:', eth_account_alice.address) |
216 | 219 | print('eth_account_bob.address:', eth_account_bob.address) |
217 | 220 |
|
| 221 | + if True: |
| 222 | + print("add funds to alice and bob") |
| 223 | + |
| 224 | + print("alice") |
| 225 | + trx_transfer = proxy.eth.account.sign_transaction(dict( |
| 226 | + nonce=proxy.eth.get_transaction_count(proxy.eth.default_account), |
| 227 | + chainId=proxy.eth.chain_id, |
| 228 | + gas=987654321, |
| 229 | + gasPrice=0, |
| 230 | + to=eth_account_alice.address, |
| 231 | + value=one_gwei), |
| 232 | + eth_account.key |
| 233 | + ) |
| 234 | + |
| 235 | + print('trx_transfer:', trx_transfer) |
| 236 | + trx_transfer_hash = proxy.eth.send_raw_transaction(trx_transfer.rawTransaction) |
| 237 | + print('trx_transfer_hash:', trx_transfer_hash.hex()) |
| 238 | + trx_transfer_receipt = proxy.eth.wait_for_transaction_receipt(trx_transfer_hash) |
| 239 | + print('trx_transfer_receipt:', trx_transfer_receipt) |
| 240 | + |
| 241 | + print("bob") |
| 242 | + trx_transfer = proxy.eth.account.sign_transaction(dict( |
| 243 | + nonce=proxy.eth.get_transaction_count(proxy.eth.default_account), |
| 244 | + chainId=proxy.eth.chain_id, |
| 245 | + gas=987654321, |
| 246 | + gasPrice=0, |
| 247 | + to=eth_account_bob.address, |
| 248 | + value=one_gwei), |
| 249 | + eth_account.key |
| 250 | + ) |
| 251 | + |
| 252 | + print('trx_transfer:', trx_transfer) |
| 253 | + trx_transfer_hash = proxy.eth.send_raw_transaction(trx_transfer.rawTransaction) |
| 254 | + print('trx_transfer_hash:', trx_transfer_hash.hex()) |
| 255 | + trx_transfer_receipt = proxy.eth.wait_for_transaction_receipt(trx_transfer_hash) |
| 256 | + print('trx_transfer_receipt:', trx_transfer_receipt) |
| 257 | + |
218 | 258 | alice_balance_before_transfer = proxy.eth.get_balance(eth_account_alice.address) |
219 | 259 | bob_balance_before_transfer = proxy.eth.get_balance(eth_account_bob.address) |
220 | 260 | print('alice_balance_before_transfer:', alice_balance_before_transfer) |
221 | 261 | print('bob_balance_before_transfer:', bob_balance_before_transfer) |
222 | | - one_gwei = 1_000_000_000 |
223 | 262 | print('one_gwei:', one_gwei) |
224 | 263 |
|
225 | 264 | trx_transfer = proxy.eth.account.sign_transaction(dict( |
@@ -248,11 +287,51 @@ def test_05_transfer_one_gwei(self): |
248 | 287 | # @unittest.skip("a.i.") |
249 | 288 | def test_06_transfer_one_and_a_half_gweis(self): |
250 | 289 | print("\ntest_06_transfer_one_and_a_half_gweis") |
| 290 | + |
251 | 291 | eth_account_alice = proxy.eth.account.create('alice') |
252 | 292 | eth_account_bob = proxy.eth.account.create('bob') |
253 | 293 | print('eth_account_alice.address:', eth_account_alice.address) |
254 | 294 | print('eth_account_bob.address:', eth_account_bob.address) |
255 | 295 |
|
| 296 | + one_gwei = 1_000_000_000 |
| 297 | + |
| 298 | + if True: |
| 299 | + print("add funds to alice and bob") |
| 300 | + |
| 301 | + print("alice") |
| 302 | + trx_transfer = proxy.eth.account.sign_transaction(dict( |
| 303 | + nonce=proxy.eth.get_transaction_count(proxy.eth.default_account), |
| 304 | + chainId=proxy.eth.chain_id, |
| 305 | + gas=987654321, |
| 306 | + gasPrice=0, |
| 307 | + to=eth_account_alice.address, |
| 308 | + value=one_gwei), |
| 309 | + eth_account.key |
| 310 | + ) |
| 311 | + |
| 312 | + print('trx_transfer:', trx_transfer) |
| 313 | + trx_transfer_hash = proxy.eth.send_raw_transaction(trx_transfer.rawTransaction) |
| 314 | + print('trx_transfer_hash:', trx_transfer_hash.hex()) |
| 315 | + trx_transfer_receipt = proxy.eth.wait_for_transaction_receipt(trx_transfer_hash) |
| 316 | + print('trx_transfer_receipt:', trx_transfer_receipt) |
| 317 | + |
| 318 | + print("bob") |
| 319 | + trx_transfer = proxy.eth.account.sign_transaction(dict( |
| 320 | + nonce=proxy.eth.get_transaction_count(proxy.eth.default_account), |
| 321 | + chainId=proxy.eth.chain_id, |
| 322 | + gas=987654321, |
| 323 | + gasPrice=0, |
| 324 | + to=eth_account_bob.address, |
| 325 | + value=one_gwei), |
| 326 | + eth_account.key |
| 327 | + ) |
| 328 | + |
| 329 | + print('trx_transfer:', trx_transfer) |
| 330 | + trx_transfer_hash = proxy.eth.send_raw_transaction(trx_transfer.rawTransaction) |
| 331 | + print('trx_transfer_hash:', trx_transfer_hash.hex()) |
| 332 | + trx_transfer_receipt = proxy.eth.wait_for_transaction_receipt(trx_transfer_hash) |
| 333 | + print('trx_transfer_receipt:', trx_transfer_receipt) |
| 334 | + |
256 | 335 | alice_balance_before_transfer = proxy.eth.get_balance(eth_account_alice.address) |
257 | 336 | bob_balance_before_transfer = proxy.eth.get_balance(eth_account_bob.address) |
258 | 337 | print('alice_balance_before_transfer:', alice_balance_before_transfer) |
|
0 commit comments