Skip to content

Commit

Permalink
feat(tests): Remove duplicate fixture within test_blob_txs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Jan 29, 2024
1 parent ba7afe0 commit ddee4dc
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions tests/cancun/eip4844_blobs/test_blob_txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,34 +479,17 @@ def header_verify(
return header_verify


@pytest.fixture
def all_blob_gas_used(
fork: Fork,
txs: List[Transaction],
block_number: int,
block_timestamp: int,
) -> Optional[int | Removable]:
"""
Calculates the blob gas used by the test block taking into account failed transactions.
"""
if not fork.header_blob_gas_used_required(
block_number=block_number, timestamp=block_timestamp
):
return Header.EMPTY_FIELD
return sum([Spec.get_total_blob_gas(tx) for tx in txs])


@pytest.fixture
def rlp_modifier(
all_blob_gas_used: Optional[int | Removable],
expected_blob_gas_used: Optional[int | Removable],
) -> Optional[Header]:
"""
Header fields to modify on the output block in the BlockchainTest.
"""
if all_blob_gas_used == Header.EMPTY_FIELD:
if expected_blob_gas_used == Header.EMPTY_FIELD:
return None
return Header(
blob_gas_used=all_blob_gas_used,
blob_gas_used=expected_blob_gas_used,
)


Expand Down

0 comments on commit ddee4dc

Please sign in to comment.