Skip to content

Commit 573224f

Browse files
committed
fix: BAL as object in fixture block so RLP is correct
1 parent b3eaa93 commit 573224f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/ethereum_test_fixtures/blockchain.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ class FixtureBlockBase(CamelModel):
443443
ommers: List[FixtureHeader] = Field(default_factory=list, alias="uncleHeaders")
444444
withdrawals: List[FixtureWithdrawal] | None = None
445445
execution_witness: WitnessChunk | None = None
446-
block_access_list: Bytes | None = Field(
447-
None, description="Serialized EIP-7928 Block Access List"
446+
block_access_list: BlockAccessList | None = Field(
447+
None, description="EIP-7928 Block Access List"
448448
)
449449

450450
@computed_field(alias="blocknumber") # type: ignore[misc]
@@ -464,6 +464,9 @@ def with_rlp(self, txs: List[Transaction]) -> "FixtureBlock":
464464
if self.withdrawals is not None:
465465
block.append([w.to_serializable_list() for w in self.withdrawals])
466466

467+
if self.block_access_list is not None:
468+
block.append(self.block_access_list.to_list())
469+
467470
return FixtureBlock(
468471
**self.model_dump(),
469472
rlp=eth_rlp.encode(block),

src/ethereum_test_specs/blockchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def get_fixture_block(self) -> FixtureBlock | InvalidFixtureBlock:
338338
if self.withdrawals is not None
339339
else None
340340
),
341-
block_access_list=self.block_access_list.rlp if self.block_access_list else None,
341+
block_access_list=self.block_access_list if self.block_access_list else None,
342342
fork=self.fork,
343343
).with_rlp(txs=self.txs)
344344

@@ -367,9 +367,9 @@ def get_fixture_engine_new_payload(self) -> FixtureEngineNewPayload:
367367
transactions=self.txs,
368368
withdrawals=self.withdrawals,
369369
requests=self.requests,
370+
block_access_list=self.block_access_list.rlp,
370371
validation_error=self.expected_exception,
371372
error_code=self.engine_api_error_code,
372-
block_access_list=self.block_access_list.rlp if self.block_access_list else None,
373373
)
374374

375375
def verify_transactions(self, transition_tool_exceptions_reliable: bool) -> List[int]:

0 commit comments

Comments
 (0)