File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
consensus_testing/test_types Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 44
55from lean_spec .subspecs .containers .state import State , Validators
66from lean_spec .subspecs .containers .validator import Validator
7- from lean_spec .types import Uint64
7+ from lean_spec .types import Bytes52 , Uint64
88
99from ..keys import get_shared_key_manager
1010
@@ -35,7 +35,10 @@ def generate_pre_state(**kwargs: Any) -> State:
3535
3636 validators = Validators (
3737 data = [
38- Validator (pubkey = key_manager [Uint64 (i )].public .encode_bytes (), index = Uint64 (i ))
38+ Validator (
39+ pubkey = Bytes52 (key_manager [Uint64 (i )].public .encode_bytes ()),
40+ index = Uint64 (i ),
41+ )
3942 for i in range (num_validators )
4043 ]
4144 )
Original file line number Diff line number Diff line change 11"""Unified CLI command for generating Ethereum test fixtures across all layers."""
22
3+ import os
34import sys
45from pathlib import Path
56from typing import Sequence
3738 is_flag = True ,
3839 help = "Clean output directory before generating" ,
3940)
41+ @click .option (
42+ "--scheme" ,
43+ type = click .Choice (["test" , "prod" ], case_sensitive = False ),
44+ default = "test" ,
45+ help = "XMSS signature scheme (default: test)" ,
46+ )
4047@click .pass_context
4148def fill (
4249 ctx : click .Context ,
@@ -45,6 +52,7 @@ def fill(
4552 fork : str ,
4653 layer : str ,
4754 clean : bool ,
55+ scheme : str ,
4856) -> None :
4957 """
5058 Generate Ethereum test fixtures from test specifications.
@@ -61,7 +69,15 @@ def fill(
6169
6270 # Default layer is consensus
6371 fill tests/spec_tests/devnet --fork=Devnet --clean -v
72+
73+ # Use specific XMSS scheme (overrides LEAN_ENV env var)
74+ fill --fork=Devnet --scheme=prod --clean -v
6475 """
76+ # Note: It's important to never import any leanSpec modules in this file, so the
77+ # `LEAN_ENV` variable can be set before the config loads its value from the
78+ # environment.
79+ os .environ ["LEAN_ENV" ] = scheme .lower ()
80+
6581 config_path = Path (__file__ ).parent / "pytest_ini_files" / "pytest-fill.ini"
6682 # Find project root by looking for pyproject.toml with [tool.uv.workspace]
6783 project_root = Path .cwd ()
Original file line number Diff line number Diff line change 77if "LEAN_ENV" not in os .environ :
88 os .environ ["LEAN_ENV" ] = "test"
99
10- import lean_spec .subspecs .xmss as xmss
11-
1210# Create a profile named "no_deadline" with deadline disabled.
1311settings .register_profile ("no_deadline" , deadline = None )
1412settings .load_profile ("no_deadline" )
You can’t perform that action at this time.
0 commit comments