Skip to content

Commit 9118cd2

Browse files
committed
add modified contract test & refactor
Signed-off-by: Ignacio Hagopian <[email protected]>
1 parent 69315cd commit 9118cd2

File tree

2 files changed

+5
-64
lines changed

2 files changed

+5
-64
lines changed

Diff for: tests/verkle/eip7748/stale_keys.py renamed to tests/verkle/eip7748/modified_accounts.py

+5-64
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
@pytest.mark.parametrize(
1313
"storage_slot_write",
1414
[
15+
None,
1516
0,
1617
1,
1718
300,
1819
301,
1920
],
2021
ids=[
22+
"No storage slot modified",
2123
"Stale storage slot in the header",
2224
"New storage slot in the account header",
2325
"Stale storage slot outside the header",
@@ -26,9 +28,9 @@
2628
)
2729
@pytest.mark.parametrize(
2830
"stale_basic_data",
29-
[True, False],
31+
[True],
3032
)
31-
def test_stale_contract_writes(
33+
def test_modified_contract(
3234
blockchain_test: BlockchainTestFiller,
3335
storage_slot_write: int,
3436
stale_basic_data: bool,
@@ -53,7 +55,7 @@ def test_stale_contract_writes(
5355
pre_state[target_account] = Account(
5456
balance=1_000,
5557
nonce=0,
56-
code=Op.SSTORE(storage_slot_write, 9999),
58+
code=Op.SSTORE(storage_slot_write, 9999) if storage_slot_write is not None else [],
5759
storage={
5860
0: 100,
5961
300: 200,
@@ -70,64 +72,3 @@ def test_stale_contract_writes(
7072
)
7173

7274
_state_conversion(blockchain_test, pre_state, stride, 1, [ConversionTx(tx, 0)])
73-
74-
75-
# @pytest.mark.valid_from("EIP6800Transition")
76-
# @pytest.mark.parametrize(
77-
# "num_storage_slots, num_stale_storage_slots",
78-
# [
79-
# (0, 0),
80-
# (4, 0),
81-
# (4, 2),
82-
# (stride, stride),
83-
# ],
84-
# ids=[
85-
# "EOA",
86-
# "Contract without stale storage",
87-
# "Contract with some stale storage",
88-
# "Contract with all stale storage",
89-
# ],
90-
# )
91-
# @pytest.mark.parametrize(
92-
# "stale_basic_data",
93-
# [True, False],
94-
# )
95-
# @pytest.mark.parametrize(
96-
# "fill_first_block",
97-
# [True, False],
98-
# )
99-
# @pytest.mark.parametrize(
100-
# "fill_last_block",
101-
# [True, False],
102-
# )
103-
# def test_stale_keys(
104-
# blockchain_test: BlockchainTestFiller,
105-
# account_configs: list[AccountConfig],
106-
# fill_first_block: bool,
107-
# fill_last_block: bool,
108-
# ):
109-
# """
110-
# Test account conversion with full/partial stale storage slots and basic data.
111-
# """
112-
# _generic_conversion(blockchain_test, account_configs, fill_first_block, fill_last_block)
113-
114-
115-
# @pytest.mark.valid_from("EIP6800Transition")
116-
# @pytest.mark.parametrize(
117-
# "fill_first_block",
118-
# [True, False],
119-
# )
120-
# @pytest.mark.parametrize(
121-
# "fill_last_block",
122-
# [True, False],
123-
# )
124-
# def test_stride_stale_eoas(
125-
# blockchain_test: BlockchainTestFiller,
126-
# account_configs: list[AccountConfig],
127-
# fill_first_block: bool,
128-
# fill_last_block: bool,
129-
# ):
130-
# """
131-
# Test converting a stride number of stale EOAs.
132-
# """
133-
# _generic_conversion(blockchain_test, account_configs, fill_first_block, fill_last_block)
File renamed without changes.

0 commit comments

Comments
 (0)