Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ def callee_address(pre: Alloc, callee_code: Bytecode) -> Address:
return pre.deploy_contract(callee_code)


@pytest.fixture
def store_slot() -> Bytecode:
"""Storage slot where to save the expected value, by default 1."""
return Op.PUSH1(1)


@pytest.fixture
def caller_code(
call_gas: int,
callee_address: Address,
store_slot: Bytecode,
) -> Bytecode:
"""Bytecode used to call the bytecode containing the BLOBBASEFEE opcode."""
return Op.SSTORE(Op.NUMBER, Op.CALL(gas=call_gas, address=callee_address))
return Op.SSTORE(store_slot, Op.CALL(gas=call_gas, address=callee_address))


@pytest.fixture
Expand Down Expand Up @@ -191,6 +198,7 @@ def test_blobbasefee_before_fork(
timestamps = [7_500, 14_999, 15_000]


@pytest.mark.parametrize("store_slot", [Op.NUMBER])
@pytest.mark.parametrize(
"caller_pre_storage",
[{block_number: 0xFF for block_number, _ in enumerate(timestamps, start=1)}],
Expand Down
Loading