Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dknopik committed Jan 3, 2025
1 parent 39aec1b commit e0da923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
31 changes: 11 additions & 20 deletions testing/web3signer_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod tests {
use tokio::time::sleep;
use types::{attestation::AttestationBase, *};
use url::Url;
use validator_store::{Error as ValidatorStoreError, ValidatorStore};
use validator_store::{Error as ValidatorStoreError, SignBlock, ValidatorStore};

/// If the we are unable to reach the Web3Signer HTTP API within this time out then we will
/// assume it failed to start.
Expand Down Expand Up @@ -310,7 +310,7 @@ mod tests {

/// A testing rig which holds a `ValidatorStore`.
struct ValidatorStoreRig {
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock>>,
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock, E>>,
_validator_dir: TempDir,
runtime: Arc<tokio::runtime::Runtime>,
_runtime_shutdown: async_channel::Sender<()>,
Expand Down Expand Up @@ -364,7 +364,7 @@ mod tests {
..Default::default()
};

let validator_store = LighthouseValidatorStore::<_>::new(
let validator_store = LighthouseValidatorStore::new(
initialized_validators,
slashing_protection,
Hash256::repeat_byte(42),
Expand Down Expand Up @@ -489,7 +489,7 @@ mod tests {
generate_sig: F,
) -> Self
where
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock>>) -> R,
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock, E>>) -> R,
R: Future<Output = S>,
// We use the `SignedObject` trait to white-list objects for comparison. This avoids
// accidentally comparing something meaningless like a `()`.
Expand Down Expand Up @@ -524,7 +524,7 @@ mod tests {
web3signer_should_sign: bool,
) -> Self
where
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock>>) -> R,
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock, E>>) -> R,
R: Future<Output = Result<(), lighthouse_validator_store::Error>>,
{
for validator_rig in &self.validator_rigs {
Expand Down Expand Up @@ -591,7 +591,7 @@ mod tests {
.await
.assert_signatures_match("randao_reveal", |pubkey, validator_store| async move {
validator_store
.randao_reveal::<E>(pubkey, Epoch::new(0))
.randao_reveal(pubkey, Epoch::new(0))
.await
.unwrap()
})
Expand Down Expand Up @@ -632,7 +632,7 @@ mod tests {
.await
.assert_signatures_match("selection_proof", |pubkey, validator_store| async move {
validator_store
.produce_selection_proof::<E>(pubkey, Slot::new(0))
.produce_selection_proof(pubkey, Slot::new(0))
.await
.unwrap()
})
Expand All @@ -642,7 +642,7 @@ mod tests {
|pubkey, validator_store| async move {
let val_reg_data = get_validator_registration(pubkey);
validator_store
.sign_validator_registration_data::<E>(val_reg_data)
.sign_validator_registration_data(val_reg_data)
.await
.unwrap()
},
Expand Down Expand Up @@ -682,11 +682,7 @@ mod tests {
"sync_selection_proof",
|pubkey, validator_store| async move {
validator_store
.produce_sync_selection_proof::<E>(
&pubkey,
altair_fork_slot,
SyncSubnetId::from(0),
)
.produce_sync_selection_proof(&pubkey, altair_fork_slot, SyncSubnetId::from(0))
.await
.unwrap()
},
Expand All @@ -696,12 +692,7 @@ mod tests {
"sync_committee_signature",
|pubkey, validator_store| async move {
validator_store
.produce_sync_committee_signature::<E>(
altair_fork_slot,
Hash256::zero(),
0,
&pubkey,
)
.produce_sync_committee_signature(altair_fork_slot, Hash256::zero(), 0, &pubkey)
.await
.unwrap()
},
Expand Down Expand Up @@ -734,7 +725,7 @@ mod tests {
|pubkey, validator_store| async move {
let val_reg_data = get_validator_registration(pubkey);
validator_store
.sign_validator_registration_data::<E>(val_reg_data)
.sign_validator_registration_data(val_reg_data)
.await
.unwrap()
},
Expand Down
6 changes: 3 additions & 3 deletions validator_client/http_api/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type E = MainnetEthSpec;
struct ApiTester {
client: ValidatorClientHttpClient,
initialized_validators: Arc<RwLock<InitializedValidators>>,
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock>>,
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock, E>>,
url: SensitiveUrl,
slot_clock: TestingSlotClock,
_validator_dir: TempDir,
Expand Down Expand Up @@ -95,7 +95,7 @@ impl ApiTester {

let test_runtime = TestRuntime::default();

let validator_store = Arc::new(LighthouseValidatorStore::<_>::new(
let validator_store = Arc::new(LighthouseValidatorStore::new(
initialized_validators,
slashing_protection,
Hash256::repeat_byte(42),
Expand All @@ -108,7 +108,7 @@ impl ApiTester {
));

validator_store
.register_all_in_doppelganger_protection_if_enabled::<E>()
.register_all_in_doppelganger_protection_if_enabled()
.expect("Should attach doppelganger service");

let initialized_validators = validator_store.initialized_validators();
Expand Down

0 comments on commit e0da923

Please sign in to comment.