|
8 | 8 | from pydantic import model_validator |
9 | 9 |
|
10 | 10 | from lean_spec.subspecs.chain.config import SECONDS_PER_SLOT |
11 | | -from lean_spec.subspecs.containers import Signature |
12 | 11 | from lean_spec.subspecs.containers.attestation import ( |
13 | 12 | Attestation, |
14 | 13 | AttestationData, |
|
26 | 25 | from lean_spec.subspecs.containers.state import Validators |
27 | 26 | from lean_spec.subspecs.containers.state.state import State |
28 | 27 | from lean_spec.subspecs.forkchoice import Store |
| 28 | +from lean_spec.subspecs.koalabear import Fp |
29 | 29 | from lean_spec.subspecs.ssz import hash_tree_root |
| 30 | +from lean_spec.subspecs.xmss.constants import PROD_CONFIG |
| 31 | +from lean_spec.subspecs.xmss.containers import ( |
| 32 | + HashDigestList, |
| 33 | + HashTreeOpening, |
| 34 | + Randomness, |
| 35 | + Signature, |
| 36 | +) |
30 | 37 | from lean_spec.subspecs.xmss.interface import TEST_SIGNATURE_SCHEME |
31 | 38 | from lean_spec.types import Bytes32, Uint64, ValidatorIndex |
32 | 39 |
|
@@ -192,11 +199,7 @@ def make_fixture(self) -> ForkChoiceTest: |
192 | 199 | # Update validator pubkeys to match key_manager's generated keys |
193 | 200 | updated_validators = [ |
194 | 201 | validator.model_copy( |
195 | | - update={ |
196 | | - "pubkey": key_manager[ValidatorIndex(i)].public.to_bytes( |
197 | | - key_manager.scheme.config |
198 | | - ) |
199 | | - } |
| 202 | + update={"pubkey": key_manager[ValidatorIndex(i)].public.encode_bytes()} |
200 | 203 | ) |
201 | 204 | for i, validator in enumerate(self.anchor_state.validators) |
202 | 205 | ] |
@@ -481,5 +484,13 @@ def _build_signed_attestation_from_spec( |
481 | 484 | # Create signed attestation |
482 | 485 | return SignedAttestation( |
483 | 486 | message=attestation, |
484 | | - signature=spec.signature if spec.signature is not None else Signature.zero(), |
| 487 | + signature=( |
| 488 | + spec.signature |
| 489 | + if spec.signature is not None |
| 490 | + else Signature( |
| 491 | + path=HashTreeOpening(siblings=HashDigestList(data=[])), |
| 492 | + rho=Randomness(data=[Fp(0) for _ in range(PROD_CONFIG.RAND_LEN_FE)]), |
| 493 | + hashes=HashDigestList(data=[]), |
| 494 | + ) |
| 495 | + ), |
485 | 496 | ) |
0 commit comments