9
9
from eth .chains .mainnet import (
10
10
MAINNET_VMS ,
11
11
)
12
- from eth .exceptions import InvalidInstruction , ReservedBytesInCode
12
+ from eth .exceptions import InvalidInstruction
13
13
from eth .vm .forks import BerlinVM
14
14
from eth .tools .factories .transaction import (
15
15
new_dynamic_fee_transaction , new_transaction ,
@@ -166,7 +166,7 @@ def test_revert_on_reserved_0xEF_byte_for_CREATE_and_CREATE2_post_london(
166
166
)
167
167
168
168
assert successful_create_computation .is_success
169
- # assert only the appropriate gas is consumed, not all the gas . This falls within a range
169
+ # assert gas is consumed. This falls within a range
170
170
assert 32261 <= successful_create_computation .get_gas_used () <= 32270
171
171
172
172
# test parameterized negative cases
@@ -182,10 +182,7 @@ def test_revert_on_reserved_0xEF_byte_for_CREATE_and_CREATE2_post_london(
182
182
)
183
183
184
184
assert revert_create_computation .is_error
185
- assert isinstance (revert_create_computation .error , ReservedBytesInCode )
186
- assert "0xef" in repr (revert_create_computation .error ).lower ()
187
-
188
- assert revert_create_computation .get_gas_used () == 40000 # assert gas is consumed
185
+ assert 35000 < revert_create_computation .get_gas_used () < 40000 # assert gas is still consumed
189
186
assert revert_create_computation .get_gas_refund () == 0
190
187
191
188
@@ -259,24 +256,19 @@ def test_state_revert_on_reserved_0xEF_byte_for_create_transaction_post_london(
259
256
data = data ,
260
257
)
261
258
262
- with pytest .raises (ReservedBytesInCode ):
263
- block_import , _ , computations = chain .mine_all (
264
- [create_contract_txn_reserved_byte ],
265
- gas_limit = 84082
266
- )
259
+ block_import , _ , computations = chain .mine_all (
260
+ [create_contract_txn_reserved_byte ],
261
+ gas_limit = 84082
262
+ )
267
263
268
- reverted_computation = computations [0 ]
269
- mined_header = block_import .imported_block .header
270
- end_balance = reverted_computation .state .get_balance (funded_address )
264
+ reverted_computation = computations [0 ]
265
+ mined_header = block_import .imported_block .header
271
266
272
- assert reverted_computation .is_error
273
- assert isinstance (reverted_computation .error , ReservedBytesInCode )
274
- assert "0xef" in repr (reverted_computation .error ).lower ()
267
+ assert reverted_computation .is_error
268
+ assert "0xef" in repr (reverted_computation .error ).lower ()
275
269
276
- assert reverted_computation .get_nonce (funded_address ) == 1 # assert nonce is still 1
277
- # reverted txn consumes the gas:
278
- assert mined_header .gas_used == 60000
279
- assert end_balance == new_balance - 60000
270
+ # reverted txn consumes the gas:
271
+ assert mined_header .gas_used == 60000
280
272
281
273
282
274
@pytest .mark .parametrize (
0 commit comments