Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ethereum_spec_tools/new_fork/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def __init__(
self.output = Path(template_path).parent

# Try to make a sane guess for the activation criteria.
if found is forks[-1]:
if found is forks[-1] or isinstance(found.criteria, Unscheduled):
order_index = 0

# check template fork's criteria and bump order_index if needed
Expand Down
9 changes: 7 additions & 2 deletions tests/json_infra/test_tools_new_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from tempfile import TemporaryDirectory

from ethereum_spec_tools.forks import Hardfork
from ethereum_spec_tools.new_fork.cli import main as new_fork


Expand All @@ -17,12 +18,16 @@ def test_end_to_end() -> None:
output_dir = Path(base_dir) / "ethereum"
fork_dir = output_dir / "e2e_fork"

# Get the latest fork dynamically to avoid breaking with new forks
forks = Hardfork.discover()
template_fork = forks[-1].short_name

new_fork(
[
"--new-fork",
"e2e_fork",
"--template-fork",
"osaka",
template_fork,
"--target-blob-gas-per-block",
"199",
"--blob-base-fee-update-fraction",
Expand All @@ -47,7 +52,7 @@ def test_end_to_end() -> None:

assert "FORK_CRITERIA = ByTimestamp(7)" in source
assert "E2E Fork" in source
assert "Osaka" not in source
assert template_fork.title() not in source

with (fork_dir / "vm" / "gas.py").open("r") as f:
source = f.read()
Expand Down
Loading