88"""
99
1010from dataclasses import dataclass
11- from remerkleable .basic import uint64
12- from remerkleable .bitfields import Bitlist
13- from remerkleable .byte_arrays import Bytes32
14- from remerkleable .complex import List
1511from pydantic import BaseModel , ConfigDict
1612
13+ from ethereum_types .bytes import Bytes32
14+ from ethereum_types .numeric import U64
15+ from ssz .sedes .bitlist import Bitlist
16+ from ssz .sedes .list import List
17+
1718from preset import MAX_HISTORICAL_BLOCK_HASHES , VALIDATOR_REGISTRY_LIMIT
1819
1920@dataclass
@@ -22,19 +23,19 @@ class State(BaseModel):
2223
2324 # Diverged from 3SF-mini.py:
2425 # - Removed `config: Config` from the state
25- # - Using uint64 instead of native int for all fields
26- # - Using Bytes32 instead of native str for all fields
26+ # - Using `U64` instead of native int for all fields
27+ # - Using ` Bytes32` instead of native str for all fields
2728
2829 latest_justified_hash : Bytes32
29- latest_justified_slot : uint64
30+ latest_justified_slot : U64
3031
3132 latest_finalized_hash : Bytes32
32- latest_finalized_slot : uint64
33+ latest_finalized_slot : U64
3334
3435 historical_block_hashes : List [Bytes32 , MAX_HISTORICAL_BLOCK_HASHES ]
3536 justified_slots : List [bool , MAX_HISTORICAL_BLOCK_HASHES ]
3637
3738 # Diverged from 3SF-mini.py:
3839 # - Flattened `justifications: Dict[str, List[bool]]` for SSZ compatibility
3940 justifications_roots : List [Bytes32 , MAX_HISTORICAL_BLOCK_HASHES ]
40- justifications_validators : Bitlist [ MAX_HISTORICAL_BLOCK_HASHES * VALIDATOR_REGISTRY_LIMIT ]
41+ justifications_validators : Bitlist ( MAX_HISTORICAL_BLOCK_HASHES * VALIDATOR_REGISTRY_LIMIT )
0 commit comments