Skip to content

Commit 691df39

Browse files
committed
fix(tests): size the merged placeholder pubkeys from PUBLIC_KEY_SIZE
The latest merge from main brought in two more test helpers (#554, #556) that build validators with hardcoded 52-byte pubkeys, which do not compile on this branch: tracking leanVM main shrinks XMSS pubkeys to 32 bytes. Reference the constant so the size follows the type, same as 8f6a6b6 did for the helpers the previous merge carried over.
1 parent 116e473 commit 691df39

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

bin/ethlambda/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ validators:
10281028
seed_db(backend.clone(), &seeded_genesis);
10291029

10301030
let mut other_genesis = test_genesis(genesis_time);
1031-
other_genesis.genesis_validators[0].attestation_pubkey = [9u8; 52];
1031+
other_genesis.genesis_validators[0].attestation_pubkey = [9u8; PUBLIC_KEY_SIZE];
10321032
let Err(err) = fetch_initial_state(&[], &other_genesis, backend).await else {
10331033
panic!("a foreign validator set must not be silently re-anchored");
10341034
};

crates/storage/src/store.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,13 +1732,14 @@ mod tests {
17321732
use super::*;
17331733
use crate::backend::InMemoryBackend;
17341734
use ethlambda_types::genesis::{GenesisMismatch, GenesisValidatorEntry};
1735+
use ethlambda_types::state::PUBLIC_KEY_SIZE;
17351736

17361737
/// Validator at `index` whose two pubkeys are filled with `seed`, so
17371738
/// changing the seed changes the registry without changing its size.
17381739
fn validator(index: u64, seed: u8) -> Validator {
17391740
Validator {
1740-
attestation_pubkey: [seed; 52],
1741-
proposal_pubkey: [seed.wrapping_add(1); 52],
1741+
attestation_pubkey: [seed; PUBLIC_KEY_SIZE],
1742+
proposal_pubkey: [seed.wrapping_add(1); PUBLIC_KEY_SIZE],
17421743
index,
17431744
}
17441745
}

0 commit comments

Comments
 (0)