Skip to content

Commit 3964afa

Browse files
committed
refactor: Refactor fillers; design fork_choice_test; remove genesis tests
- Remove genesis tests for now since we don't have the need yet - Refactor fillers and add a ``fork_choice_test`` type
1 parent 0bd95d4 commit 3964afa

File tree

22 files changed

+710
-583
lines changed

22 files changed

+710
-583
lines changed

packages/tests/src/lean_spec_tests/__init__.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,43 @@
55
from .base_types import CamelModel
66
from .builders import BlockBuilder
77
from .consensus_env import ConsensusEnvironment
8-
from .filler_api import genesis_test, state_transition_test
9-
from .spec_fixtures import (
8+
from .test_fixtures import (
109
BaseConsensusFixture,
1110
ForkChoiceTest,
12-
GenesisTest,
1311
StateTransitionTest,
1412
)
13+
from .test_types import (
14+
AttestationStep,
15+
BaseForkChoiceStep,
16+
BlockStep,
17+
ForkChoiceStep,
18+
StateExpectation,
19+
StoreChecks,
20+
TickStep,
21+
)
1522

16-
GenesisTestFiller = Type[GenesisTest]
1723
StateTransitionTestFiller = Type[StateTransitionTest]
24+
ForkChoiceTestFiller = Type[ForkChoiceTest]
1825

1926
__all__ = [
2027
# Public API
21-
"genesis_test",
22-
"state_transition_test",
2328
"ConsensusEnvironment",
2429
"BlockBuilder",
2530
# Base types
2631
"CamelModel",
2732
# Fixture classes
2833
"BaseConsensusFixture",
29-
"GenesisTest",
3034
"StateTransitionTest",
3135
"ForkChoiceTest",
36+
# Test types
37+
"BaseForkChoiceStep",
38+
"TickStep",
39+
"BlockStep",
40+
"AttestationStep",
41+
"ForkChoiceStep",
42+
"StateExpectation",
43+
"StoreChecks",
3244
# Type aliases for test function signatures
33-
"GenesisTestFiller",
3445
"StateTransitionTestFiller",
46+
"ForkChoiceTestFiller",
3547
]

packages/tests/src/lean_spec_tests/builders.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def build(
7373
slot=slot,
7474
proposer_index=proposer_index,
7575
parent_root=parent_root,
76-
state_root=Bytes32.zero(), # Will compute this
76+
state_root=Bytes32.zero(),
7777
body=body,
7878
)
7979

@@ -92,7 +92,6 @@ def build(
9292
body=body,
9393
)
9494

95-
# Sign it (placeholder signature for now)
9695
signed_block = SignedBlock(
9796
message=final_block,
9897
signature=Bytes32.zero(),

packages/tests/src/lean_spec_tests/filler_api.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

packages/tests/src/lean_spec_tests/fillers/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/tests/src/lean_spec_tests/fillers/chain.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/tests/src/lean_spec_tests/fillers/genesis.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)