Skip to content

Commit e8efbfc

Browse files
committed
fix tests
1 parent a1dae51 commit e8efbfc

File tree

2 files changed

+14
-23
lines changed
  • testing/web3signer_tests/src
  • validator_client/http_api/src

2 files changed

+14
-23
lines changed

testing/web3signer_tests/src/lib.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mod tests {
4646
use tokio::time::sleep;
4747
use types::{attestation::AttestationBase, *};
4848
use url::Url;
49-
use validator_store::{Error as ValidatorStoreError, ValidatorStore};
49+
use validator_store::{Error as ValidatorStoreError, SignBlock, ValidatorStore};
5050

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

311311
/// A testing rig which holds a `ValidatorStore`.
312312
struct ValidatorStoreRig {
313-
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock>>,
313+
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock, E>>,
314314
_validator_dir: TempDir,
315315
runtime: Arc<tokio::runtime::Runtime>,
316316
_runtime_shutdown: async_channel::Sender<()>,
@@ -364,7 +364,7 @@ mod tests {
364364
..Default::default()
365365
};
366366

367-
let validator_store = LighthouseValidatorStore::<_>::new(
367+
let validator_store = LighthouseValidatorStore::new(
368368
initialized_validators,
369369
slashing_protection,
370370
Hash256::repeat_byte(42),
@@ -489,7 +489,7 @@ mod tests {
489489
generate_sig: F,
490490
) -> Self
491491
where
492-
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock>>) -> R,
492+
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock, E>>) -> R,
493493
R: Future<Output = S>,
494494
// We use the `SignedObject` trait to white-list objects for comparison. This avoids
495495
// accidentally comparing something meaningless like a `()`.
@@ -524,7 +524,7 @@ mod tests {
524524
web3signer_should_sign: bool,
525525
) -> Self
526526
where
527-
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock>>) -> R,
527+
F: Fn(PublicKeyBytes, Arc<LighthouseValidatorStore<TestingSlotClock, E>>) -> R,
528528
R: Future<Output = Result<(), lighthouse_validator_store::Error>>,
529529
{
530530
for validator_rig in &self.validator_rigs {
@@ -591,7 +591,7 @@ mod tests {
591591
.await
592592
.assert_signatures_match("randao_reveal", |pubkey, validator_store| async move {
593593
validator_store
594-
.randao_reveal::<E>(pubkey, Epoch::new(0))
594+
.randao_reveal(pubkey, Epoch::new(0))
595595
.await
596596
.unwrap()
597597
})
@@ -632,7 +632,7 @@ mod tests {
632632
.await
633633
.assert_signatures_match("selection_proof", |pubkey, validator_store| async move {
634634
validator_store
635-
.produce_selection_proof::<E>(pubkey, Slot::new(0))
635+
.produce_selection_proof(pubkey, Slot::new(0))
636636
.await
637637
.unwrap()
638638
})
@@ -642,7 +642,7 @@ mod tests {
642642
|pubkey, validator_store| async move {
643643
let val_reg_data = get_validator_registration(pubkey);
644644
validator_store
645-
.sign_validator_registration_data::<E>(val_reg_data)
645+
.sign_validator_registration_data(val_reg_data)
646646
.await
647647
.unwrap()
648648
},
@@ -682,11 +682,7 @@ mod tests {
682682
"sync_selection_proof",
683683
|pubkey, validator_store| async move {
684684
validator_store
685-
.produce_sync_selection_proof::<E>(
686-
&pubkey,
687-
altair_fork_slot,
688-
SyncSubnetId::from(0),
689-
)
685+
.produce_sync_selection_proof(&pubkey, altair_fork_slot, SyncSubnetId::from(0))
690686
.await
691687
.unwrap()
692688
},
@@ -696,12 +692,7 @@ mod tests {
696692
"sync_committee_signature",
697693
|pubkey, validator_store| async move {
698694
validator_store
699-
.produce_sync_committee_signature::<E>(
700-
altair_fork_slot,
701-
Hash256::zero(),
702-
0,
703-
&pubkey,
704-
)
695+
.produce_sync_committee_signature(altair_fork_slot, Hash256::zero(), 0, &pubkey)
705696
.await
706697
.unwrap()
707698
},
@@ -734,7 +725,7 @@ mod tests {
734725
|pubkey, validator_store| async move {
735726
let val_reg_data = get_validator_registration(pubkey);
736727
validator_store
737-
.sign_validator_registration_data::<E>(val_reg_data)
728+
.sign_validator_registration_data(val_reg_data)
738729
.await
739730
.unwrap()
740731
},

validator_client/http_api/src/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type E = MainnetEthSpec;
4343
struct ApiTester {
4444
client: ValidatorClientHttpClient,
4545
initialized_validators: Arc<RwLock<InitializedValidators>>,
46-
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock>>,
46+
validator_store: Arc<LighthouseValidatorStore<TestingSlotClock, E>>,
4747
url: SensitiveUrl,
4848
slot_clock: TestingSlotClock,
4949
_validator_dir: TempDir,
@@ -95,7 +95,7 @@ impl ApiTester {
9595

9696
let test_runtime = TestRuntime::default();
9797

98-
let validator_store = Arc::new(LighthouseValidatorStore::<_>::new(
98+
let validator_store = Arc::new(LighthouseValidatorStore::new(
9999
initialized_validators,
100100
slashing_protection,
101101
Hash256::repeat_byte(42),
@@ -108,7 +108,7 @@ impl ApiTester {
108108
));
109109

110110
validator_store
111-
.register_all_in_doppelganger_protection_if_enabled::<E>()
111+
.register_all_in_doppelganger_protection_if_enabled()
112112
.expect("Should attach doppelganger service");
113113

114114
let initialized_validators = validator_store.initialized_validators();

0 commit comments

Comments
 (0)