Test Tstorage¶
Documentation for tests/cancun/eip1153_tstore/test_tstorage.py
.
Generate fixtures for these test cases for Cancun with:
Cancun only:
fill -v tests/cancun/eip1153_tstore/test_tstorage.py --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version
fill -v tests/cancun/eip1153_tstore/test_tstorage.py --until=Cancun --evm-bin=/path/to/evm-tool-dev-version
abstract: Tests EIP-1153: Transient Storage Opcodes
Test [EIP-1153: Transient Storage Opcodes](https://eips.ethereum.org/EIPS/eip-1153). Ports
and extends some tests from
[ethereum/tests/src/EIPTestsFiller/StateTests/stEIP1153-transientStorage/](https://github.com/ethereum/tests/blob/9b00b68593f5869eb51a6659e1cc983e875e616b/src/EIPTestsFiller/StateTests/stEIP1153-transientStorage)
test_transient_storage_unset_values(state_test)
¶
Test that tload returns zero for unset values. Loading an arbitrary value is 0 at beginning of transaction: TLOAD(x) is 0.
Based on ethereum/tests/.../01_tloadBeginningTxnFiller.yml", # noqa: E501
Source code in tests/cancun/eip1153_tstore/test_tstorage.py
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 |
|
test_tload_after_tstore(state_test)
¶
Loading after storing returns the stored value: TSTORE(x, y), TLOAD(x) returns y.
Based on ethereum/tests/.../02_tloadAfterTstoreFiller.yml", # noqa: E501
Source code in tests/cancun/eip1153_tstore/test_tstorage.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
test_tload_after_sstore(state_test)
¶
Loading after storing returns the stored value: TSTORE(x, y), TLOAD(x) returns y.
Based on ethereum/tests/.../18_tloadAfterStoreFiller.yml", # noqa: E501
Source code in tests/cancun/eip1153_tstore/test_tstorage.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
test_tload_after_tstore_is_zero(state_test)
¶
Test that tload returns zero after tstore is called with zero.
Based on ethereum/tests/.../03_tloadAfterStoreIs0Filler.yml", # noqa: E501
Source code in tests/cancun/eip1153_tstore/test_tstorage.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
test_gas_usage(state_test, bytecode, expected_gas, overhead_cost, extra_stack_items)
¶
Test that tstore and tload consume the expected gas.
Source code in tests/cancun/eip1153_tstore/test_tstorage.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|