Skip to content

Commit f10c227

Browse files
committed
Fix test: was testing incompatible VMs
It just didn't show up because this is the first time that the VM header validation rules vary so significantly.
1 parent 5e0a2a2 commit f10c227

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/core/vm/test_vm.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@
1717

1818

1919
@pytest.fixture(params=MAINNET_VMS)
20-
def pow_consensus_chain(request):
20+
def vm_class(request):
21+
return request.param
22+
23+
24+
@pytest.fixture
25+
def pow_consensus_chain(vm_class):
2126
return api.build(
2227
MiningChain,
23-
api.fork_at(request.param, 0),
28+
api.fork_at(vm_class, 0),
2429
api.genesis(),
2530
)
2631

2732

28-
@pytest.fixture(params=MAINNET_VMS)
29-
def noproof_consensus_chain(request):
33+
@pytest.fixture
34+
def noproof_consensus_chain(vm_class):
35+
# This will always have the same vm configuration as the POW chain
3036
return api.build(
3137
MiningChain,
32-
api.fork_at(request.param, 0),
38+
api.fork_at(vm_class, 0),
3339
api.disable_pow_check(),
3440
api.genesis(params=dict(gas_limit=100000)),
3541
)
@@ -100,7 +106,7 @@ def test_import_block(chain, funded_address, funded_address_private_key):
100106

101107

102108
def test_validate_header_succeeds_but_pow_fails(pow_consensus_chain, noproof_consensus_chain):
103-
# Create to "structurally valid" blocks that are not backed by PoW
109+
# Create two "structurally valid" blocks that are not backed by PoW
104110
block1 = noproof_consensus_chain.mine_block()
105111
block2 = noproof_consensus_chain.mine_block()
106112

0 commit comments

Comments
 (0)