Skip to content

Commit 10e5ad6

Browse files
committed
fix(eof): eofwrap.py to ignore invalid blocks
1 parent b820167 commit 10e5ad6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/cli/eofwrap.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ class EofWrapper:
9191
FIXTURES_CANT_WRAP = "fixtures_cant_wrap"
9292
# Test fixtures with EOF code but test doesn't pass and generation fails
9393
FIXTURES_CANT_GENERATE = "fixtures_cant_generate"
94+
# Invalid blocks in fixtures skipped
95+
INVALID_BLOCKS_SKIPPED = "invalid_blocks_skipped"
9496
# State accounts with code wrapped into valid EOF
9597
ACCOUNTS_WRAPPED = "accounts_wrapped"
9698
# State accounts with code wrapped into valid unique EOF
@@ -111,6 +113,7 @@ def __init__(self):
111113
self.FIXTURES_GENERATED: 0,
112114
self.FIXTURES_CANT_WRAP: 0,
113115
self.FIXTURES_CANT_GENERATE: 0,
116+
self.INVALID_BLOCKS_SKIPPED: 0,
114117
self.ACCOUNTS_WRAPPED: 0,
115118
self.UNIQUE_ACCOUNTS_WRAPPED: 0,
116119
self.ACCOUNTS_INVALID_EOF: 0,
@@ -283,16 +286,16 @@ def _wrap_fixture(self, fixture: BlockchainFixture, traces: bool):
283286
**fixture_tx_dump,
284287
)
285288
block.txs.append(tx)
289+
290+
test.blocks.append(block)
286291
elif isinstance(fixture_block, InvalidFixtureBlock):
287-
block = Block(
288-
rlp=fixture_block.rlp,
289-
exception=fixture_block.expect_exception,
290-
)
292+
# Skip - invalid blocks are not supported. Reason: FixtureTransaction doesn't
293+
# support expected exception. But we can continue and test the remaining
294+
# blocks.
295+
self.metrics[self.INVALID_BLOCKS_SKIPPED] += 1
291296
else:
292297
raise TypeError("not a FixtureBlock")
293298

294-
test.blocks.append(block)
295-
296299
result = test.generate(
297300
request=None, # type: ignore
298301
t8n=t8n,

0 commit comments

Comments
 (0)