test_basic_tload_other_after_tstore()
Documentation for tests/cancun/eip1153_tstore/test_basic_tload.py::test_basic_tload_other_after_tstore@343274cc.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/cancun/eip1153_tstore/test_basic_tload.py::test_basic_tload_other_after_tstore --fork Amsterdam
Ported .json vectors.
(03_tloadAfterStoreIs0Filler.yml)
Loading any other slot after storing to a slot returns 0.
Source code in tests/cancun/eip1153_tstore/test_basic_tload.py
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164 | @pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/03_tloadAfterStoreIs0Filler.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_other_after_tstore(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""
Ported .json vectors.
(03_tloadAfterStoreIs0Filler.yml)
Loading any other slot after storing to a slot returns 0.
"""
tstore_value = 88
slot_tload_untouched_slot_after_tstore_result = 1
slot_code_worked = 2
address_to = pre.deploy_contract(
code=Op.JUMPDEST()
# 03 test
+ Op.TSTORE(3, tstore_value)
+ Op.SSTORE(slot_tload_untouched_slot_after_tstore_result, Op.TLOAD(0))
+ Op.SSTORE(slot_code_worked, 1),
storage={
slot_tload_untouched_slot_after_tstore_result: 0xFF,
},
)
post = {
address_to: Account(
storage={
slot_tload_untouched_slot_after_tstore_result: 0x00,
slot_code_worked: 0x01,
}
)
}
tx = Transaction(sender=pre.fund_eoa(), to=address_to)
state_test(pre=pre, post=post, tx=tx)
|
Parametrized Test Cases
This test generates 1 parametrized test case across 4 forks.