Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -1073,19 +1073,13 @@ def test_bal_noop_storage_write(
) -> None:
"""Test that BAL correctly handles no-op storage write."""
alice = pre.fund_eoa()
storage_contract = pre.deploy_contract(
code=Op.SSTORE(0x01, 0x42), storage={0x01: 0x42}
code = Op.SSTORE(
0x01, 0x42, key_warm=False, original_value=0, new_value=0x42
)
storage_contract = pre.deploy_contract(code=code, storage={0x01: 0x42})

intrinsic_gas_calculator = fork.transaction_intrinsic_cost_calculator()
gas_limit = (
intrinsic_gas_calculator()
# Sufficient gas for write
+ fork.gas_costs().G_COLD_SLOAD
+ fork.gas_costs().G_COLD_ACCOUNT_ACCESS
+ fork.gas_costs().G_STORAGE_SET
+ fork.gas_costs().G_BASE * 10 # Buffer for push
)
gas_limit = intrinsic_gas_calculator() + code.gas_cost(fork)

tx = Transaction(
sender=alice, to=storage_contract, gas_limit=gas_limit, gas_price=0xA
Expand Down
Loading
Loading