Skip to content

Commit

Permalink
verkle: add extra SSTORE test
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
  • Loading branch information
jsign committed Nov 4, 2024
1 parent b08a60a commit ac16617
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@
],
)
def test_storage_slot_write(blockchain_test: BlockchainTestFiller, fork: str, slot_num):
_storage_slot_write(blockchain_test, fork, slot_num)


@pytest.mark.valid_from("Verkle")
def test_storage_slot_write_absent_zero(blockchain_test: BlockchainTestFiller, fork: str):
_storage_slot_write(blockchain_test, fork, 0x88, slot_value=0x00)


def _storage_slot_write(
blockchain_test: BlockchainTestFiller, fork: str, slot_num, slot_value: int = 0x42
):
"""
Test that storage slot writes work as expected.
"""
Expand All @@ -66,7 +77,7 @@ def test_storage_slot_write(blockchain_test: BlockchainTestFiller, fork: str, sl
to=None,
gas_limit=100000000,
gas_price=10,
data=Op.SSTORE(slot_num, 0x42),
data=Op.SSTORE(slot_num, slot_value),
)
blocks = [Block(txs=[tx])]

Expand All @@ -75,7 +86,7 @@ def test_storage_slot_write(blockchain_test: BlockchainTestFiller, fork: str, sl
post = {
contract_address: Account(
storage={
slot_num: 0x42,
slot_num: slot_value,
},
),
}
Expand Down

0 comments on commit ac16617

Please sign in to comment.