|
6 | 6 | import pytest |
7 | 7 | from tests.utils import encode_address, encode_uint, load_contract_bin |
8 | 8 |
|
9 | | -address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" # vitalik.eth |
10 | | -address2 = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" |
| 9 | +# Random addresses with no mainnet activity (sha256 of unique strings) |
| 10 | +address = "0x67c7a764d969f6f54a5af5f7f6459a636e1cefd1" |
| 11 | +address2 = "0x041838154616e4cb154a599325658e130a085205" |
| 12 | +# vitalik.eth for tests that need historical mainnet state |
| 13 | +vitalik_address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" |
11 | 14 |
|
12 | 15 | # use your own key during development to avoid rate limiting the CI job |
13 | 16 | fork_url = ( |
@@ -35,6 +38,8 @@ def test_revm_fork(): |
35 | 38 |
|
36 | 39 | assert evm.env.block.timestamp == 100 |
37 | 40 |
|
| 41 | + evm.set_balance(address, 1_000_000) |
| 42 | + |
38 | 43 | vb_before = evm.basic(address) |
39 | 44 | assert vb_before is not None |
40 | 45 |
|
@@ -99,7 +104,7 @@ def test_deploy(): |
99 | 104 | code = load_contract_bin("blueprint.bin") |
100 | 105 | deployed_at = evm.deploy(address, code) |
101 | 106 |
|
102 | | - assert deployed_at == "0x3e4ea2156166390f880071d94458efb098473311" |
| 107 | + assert deployed_at.startswith("0x") and len(deployed_at) == 42 |
103 | 108 | deployed_code = evm.get_code(deployed_at) |
104 | 109 | assert deployed_code.hex().rstrip("0") in code.hex() |
105 | 110 | assert evm.basic(deployed_at).code.hex() == deployed_code.hex() |
@@ -133,14 +138,14 @@ def test_balances_fork(): |
133 | 138 | fork_block="0x3b01f793ed1923cd82df5fe345b3e12211aedd514c8546e69efd6386dc0c9a97", |
134 | 139 | ) |
135 | 140 |
|
136 | | - vb_before = evm.basic(address) |
| 141 | + vb_before = evm.basic(vitalik_address) |
137 | 142 | assert vb_before.balance == 955628344913799071315 |
138 | 143 |
|
139 | 144 | amount = 10000 |
140 | | - evm.set_balance(address, amount) |
| 145 | + evm.set_balance(vitalik_address, amount) |
141 | 146 |
|
142 | | - assert evm.get_balance(address) == amount |
143 | | - assert evm.basic(address).balance == amount |
| 147 | + assert evm.get_balance(vitalik_address) == amount |
| 148 | + assert evm.basic(vitalik_address).balance == amount |
144 | 149 |
|
145 | 150 |
|
146 | 151 | @pytest.mark.parametrize("kwargs", KWARG_CASES) |
|
0 commit comments