@@ -77,7 +77,7 @@ def __init__(self, t8n: "T8N", stdin: Optional[Dict] = None):
77
77
self .read_withdrawals (data , t8n )
78
78
79
79
self .parent_beacon_block_root = None
80
- if t8n .fork .is_after_fork ("ethereum.forks. cancun" ):
80
+ if t8n .fork .is_after_fork ("cancun" ):
81
81
if not t8n .options .state_test :
82
82
parent_beacon_block_root_hex = data ["parentBeaconBlockRoot" ]
83
83
self .parent_beacon_block_root = (
@@ -96,7 +96,7 @@ def read_excess_blob_gas(self, data: Any, t8n: "T8N") -> None:
96
96
self .parent_excess_blob_gas = U64 (0 )
97
97
self .excess_blob_gas = None
98
98
99
- if not t8n .fork .is_after_fork ("ethereum.forks. cancun" ):
99
+ if not t8n .fork .is_after_fork ("cancun" ):
100
100
return
101
101
102
102
if "currentExcessBlobGas" in data :
@@ -131,7 +131,7 @@ def read_excess_blob_gas(self, data: Any, t8n: "T8N") -> None:
131
131
else :
132
132
self .excess_blob_gas = parent_blob_gas - target_blob_gas_per_block
133
133
134
- if t8n .fork .is_after_fork ("ethereum.forks. osaka" ):
134
+ if t8n .fork .is_after_fork ("osaka" ):
135
135
# Under certain conditions specified in EIP-7918, the
136
136
# the excess_blob_gas is calculated differently in osaka
137
137
assert self .parent_base_fee_per_gas is not None
@@ -170,7 +170,7 @@ def read_base_fee_per_gas(self, data: Any, t8n: "T8N") -> None:
170
170
self .parent_base_fee_per_gas = None
171
171
self .base_fee_per_gas = None
172
172
173
- if t8n .fork .is_after_fork ("ethereum.forks. london" ):
173
+ if t8n .fork .is_after_fork ("london" ):
174
174
if "currentBaseFee" in data :
175
175
self .base_fee_per_gas = parse_hex_or_int (
176
176
data ["currentBaseFee" ], Uint
@@ -212,7 +212,7 @@ def read_randao(self, data: Any, t8n: "T8N") -> None:
212
212
Read the randao from the data.
213
213
"""
214
214
self .prev_randao = None
215
- if t8n .fork .is_after_fork ("ethereum.forks. paris" ):
215
+ if t8n .fork .is_after_fork ("paris" ):
216
216
# tf tool might not always provide an
217
217
# even number of nibbles in the randao
218
218
# This could create issues in the
@@ -233,7 +233,7 @@ def read_withdrawals(self, data: Any, t8n: "T8N") -> None:
233
233
Read the withdrawals from the data.
234
234
"""
235
235
self .withdrawals = None
236
- if t8n .fork .is_after_fork ("ethereum.forks. shanghai" ):
236
+ if t8n .fork .is_after_fork ("shanghai" ):
237
237
self .withdrawals = tuple (
238
238
t8n .json_to_withdrawals (wd ) for wd in data ["withdrawals" ]
239
239
)
@@ -248,7 +248,7 @@ def read_block_difficulty(self, data: Any, t8n: "T8N") -> None:
248
248
self .parent_timestamp = None
249
249
self .parent_difficulty = None
250
250
self .parent_ommers_hash = None
251
- if t8n .fork .is_after_fork ("ethereum.forks. paris" ):
251
+ if t8n .fork .is_after_fork ("paris" ):
252
252
return
253
253
elif "currentDifficulty" in data :
254
254
self .block_difficulty = parse_hex_or_int (
@@ -267,7 +267,7 @@ def read_block_difficulty(self, data: Any, t8n: "T8N") -> None:
267
267
self .parent_timestamp ,
268
268
self .parent_difficulty ,
269
269
]
270
- if t8n .fork .is_after_fork ("ethereum.forks. byzantium" ):
270
+ if t8n .fork .is_after_fork ("byzantium" ):
271
271
if "parentUncleHash" in data :
272
272
EMPTY_OMMER_HASH = keccak256 (rlp .encode ([])) # noqa N806
273
273
self .parent_ommers_hash = Hash32 (
@@ -286,10 +286,7 @@ def read_block_hashes(self, data: Any, t8n: "T8N") -> None:
286
286
Read the block hashes. Returns a maximum of 256 block hashes.
287
287
"""
288
288
self .parent_hash = None
289
- if (
290
- t8n .fork .is_after_fork ("ethereum.forks.prague" )
291
- and not t8n .options .state_test
292
- ):
289
+ if t8n .fork .is_after_fork ("prague" ) and not t8n .options .state_test :
293
290
self .parent_hash = Hash32 (hex_to_bytes (data ["parentHash" ]))
294
291
295
292
# Read the block hashes
0 commit comments