Skip to content

Commit 718a964

Browse files
committed
WIP: silence ported static tests; fix lint
1 parent e95d7ad commit 718a964

9 files changed

Lines changed: 1648 additions & 26 deletions

File tree

tests/frontier/opcodes/test_blockhash.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ def test_genesis_hash_available(
5353
sender = pre.fund_eoa()
5454

5555
intrinsic = fork.transaction_intrinsic_cost_calculator()
56-
tx_gas_limit = (
57-
intrinsic() + code.gas_cost(fork) + fork.sstore_state_gas()
58-
)
56+
tx_gas_limit = intrinsic() + code.gas_cost(fork) + fork.sstore_state_gas()
5957
blocks = (
6058
[
6159
Block(

tests/frontier/opcodes/test_dup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ def test_dup(
7171
ty=0x0,
7272
to=account,
7373
gas_limit=(
74-
intrinsic()
75-
+ account_code.gas_cost(fork)
76-
+ fork.sstore_state_gas()
74+
intrinsic() + account_code.gas_cost(fork) + fork.sstore_state_gas()
7775
),
7876
gas_price=10,
7977
protected=fork.supports_protected_txs(),

tests/osaka/eip7918_blob_reserve_price/test_blob_base_fee.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def tx_gas(fork: Fork, destination_code: Bytecode) -> int:
5959
"""
6060
intrinsic = fork.transaction_intrinsic_cost_calculator()
6161
return (
62-
intrinsic()
63-
+ destination_code.gas_cost(fork)
64-
+ fork.sstore_state_gas()
62+
intrinsic() + destination_code.gas_cost(fork) + fork.sstore_state_gas()
6563
)
6664

6765

tests/osaka/eip7939_count_leading_zeros/test_count_leading_zeros.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ def test_clz_stack_not_overflow(
258258
tx = Transaction(
259259
to=code_address,
260260
sender=pre.fund_eoa(),
261-
gas_limit=(
262-
intrinsic() + code_regular + code_state + eip_1706_slack
263-
),
261+
gas_limit=(intrinsic() + code_regular + code_state + eip_1706_slack),
264262
)
265263

266264
expected_gas_used = max(intrinsic() + code_regular, code_state)
@@ -447,9 +445,7 @@ def test_clz_jump_operation(
447445
# the EIP-7825 cap so the EIP-8037 reservoir holds the callee's state
448446
# work and parent's SSTORE state, plus EIP-1706 slack.
449447
gas_cap = fork.transaction_gas_limit_cap()
450-
state_needed = (
451-
caller_code.state_cost(fork) + callee_code.state_cost(fork)
452-
)
448+
state_needed = caller_code.state_cost(fork) + callee_code.state_cost(fork)
453449
if gas_cap is not None and state_needed > 0:
454450
gas_limit = gas_cap + state_needed + fork.sstore_state_gas()
455451
else:

tests/ported_static/amsterdam_skip_list.txt

Lines changed: 558 additions & 1 deletion
Large diffs are not rendered by default.

tests/ported_static/amsterdam_skip_list.txt.bak

Lines changed: 1075 additions & 0 deletions
Large diffs are not rendered by default.

tests/prague/eip7002_el_triggerable_withdrawals/helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ def transactions(self, fork: Fork | None = None) -> List[Transaction]:
217217
# slot once per call. Fund the reservoir for `3*N + 2` SSTOREs
218218
# (one tail slot + one slack slot) so the entire state-set
219219
# work stays off `gas_left` under EIP-8037.
220-
gas_limit += (
221-
(len(self.requests) * 3 + 2) * fork.sstore_state_gas()
222-
)
220+
gas_limit += (len(self.requests) * 3 + 2) * fork.sstore_state_gas()
223221
return [
224222
Transaction(
225223
gas_limit=gas_limit,

tests/prague/eip7251_consolidations/conftest.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,22 @@ def blocks(
108108
included_requests,
109109
fillvalue=[],
110110
):
111-
header_verify: Header | None = None
112-
if fork.fork_at(
111+
active_fork = fork.fork_at(
113112
block_number=len(blocks) + 1, timestamp=timestamp
114-
).header_requests_required():
113+
)
114+
header_verify: Header | None = None
115+
if active_fork.header_requests_required():
115116
header_verify = Header(
116117
requests_hash=Requests(*block_included_requests)
117118
)
118119
else:
119120
assert not block_included_requests
120121
blocks.append(
121122
Block(
122-
txs=sum((r.transactions(fork) for r in block_requests), []),
123+
txs=sum(
124+
(r.transactions(active_fork) for r in block_requests),
125+
[],
126+
),
123127
header_verify=header_verify,
124128
timestamp=timestamp,
125129
)

tests/prague/eip7251_consolidations/helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,7 @@ def transactions(self, fork: Fork | None = None) -> List[Transaction]:
208208
# tail/count slot once per call. Fund the reservoir for
209209
# `4*N + 2` SSTOREs (one tail slot + one slack slot) so the
210210
# entire state-set work stays off `gas_left` under EIP-8037.
211-
gas_limit += (
212-
(len(self.requests) * 4 + 2) * fork.sstore_state_gas()
213-
)
211+
gas_limit += (len(self.requests) * 4 + 2) * fork.sstore_state_gas()
214212
return [
215213
Transaction(
216214
gas_limit=gas_limit,

0 commit comments

Comments
 (0)