test_basic_tload_transaction_begin()
Documentation for tests/cancun/eip1153_tstore/test_basic_tload.py::test_basic_tload_transaction_begin@892e6d1e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/cancun/eip1153_tstore/test_basic_tload.py::test_basic_tload_transaction_begin --fork Amsterdam
Ported .json vectors.
(01_tloadBeginningTxnFiller.yml)
load arbitrary value is 0 at beginning of transaction
Source code in tests/cancun/eip1153_tstore/test_basic_tload.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 | @pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxnFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_transaction_begin(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""
Ported .json vectors.
(01_tloadBeginningTxnFiller.yml)
load arbitrary value is 0 at beginning of transaction
"""
slot_tload_at_transaction_begin_result = 1
slot_code_worked = 2
address_to = pre.deploy_contract(
code=Op.JUMPDEST()
# 01 test
+ Op.SSTORE(slot_tload_at_transaction_begin_result, Op.TLOAD(0))
+ Op.SSTORE(slot_code_worked, 1),
storage={
slot_tload_at_transaction_begin_result: 0xFF,
},
)
post = {
address_to: Account(
storage={
slot_tload_at_transaction_begin_result: 0x00,
slot_code_worked: 0x01,
}
)
}
tx = Transaction(
sender=pre.fund_eoa(7_000_000_000_000_000_000),
to=address_to,
gas_price=10,
data=b"",
gas_limit=5000000,
value=0,
)
state_test(env=Environment(), pre=pre, post=post, tx=tx)
|
Parametrized Test Cases
This test generates 1 parametrized test case across 4 forks.