Skip to content

Commit a8fb21e

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 a8fb21e

File tree

26 files changed

+713
-817
lines changed

26 files changed

+713
-817
lines changed

packages/tests/src/lean_spec_tests/__init__.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,42 @@
44

55
from .base_types import CamelModel
66
from .builders import BlockBuilder
7-
from .consensus_env import ConsensusEnvironment
8-
from .filler_api import genesis_test, state_transition_test
9-
from .spec_fixtures import (
7+
from .test_fixtures import (
108
BaseConsensusFixture,
119
ForkChoiceTest,
12-
GenesisTest,
1310
StateTransitionTest,
1411
)
12+
from .test_types import (
13+
AttestationStep,
14+
BaseForkChoiceStep,
15+
BlockStep,
16+
ForkChoiceStep,
17+
StateExpectation,
18+
StoreChecks,
19+
TickStep,
20+
)
1521

16-
GenesisTestFiller = Type[GenesisTest]
1722
StateTransitionTestFiller = Type[StateTransitionTest]
23+
ForkChoiceTestFiller = Type[ForkChoiceTest]
1824

1925
__all__ = [
2026
# Public API
21-
"genesis_test",
22-
"state_transition_test",
23-
"ConsensusEnvironment",
2427
"BlockBuilder",
2528
# Base types
2629
"CamelModel",
2730
# Fixture classes
2831
"BaseConsensusFixture",
29-
"GenesisTest",
3032
"StateTransitionTest",
3133
"ForkChoiceTest",
34+
# Test types
35+
"BaseForkChoiceStep",
36+
"TickStep",
37+
"BlockStep",
38+
"AttestationStep",
39+
"ForkChoiceStep",
40+
"StateExpectation",
41+
"StoreChecks",
3242
# Type aliases for test function signatures
33-
"GenesisTestFiller",
3443
"StateTransitionTestFiller",
44+
"ForkChoiceTestFiller",
3545
]

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/consensus_env.py

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

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.

0 commit comments

Comments
 (0)