Skip to content

Commit 7ca65cf

Browse files
committed
fix tests
1 parent b6413ef commit 7ca65cf

File tree

2 files changed

+13
-10
lines changed
  • testing/web3signer_tests/src
  • validator_client/validator_store/src

2 files changed

+13
-10
lines changed

testing/web3signer_tests/src/lib.rs

Lines changed: 11 additions & 10 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, SignBlock, ValidatorStore};
49+
use validator_store::{Error as ValidatorStoreError, SignedBlock, 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.
@@ -75,6 +75,7 @@ mod tests {
7575
impl SignedObject for Signature {}
7676
impl SignedObject for Attestation<E> {}
7777
impl SignedObject for SignedBeaconBlock<E> {}
78+
impl SignedObject for SignedBlock<E> {}
7879
impl SignedObject for SignedAggregateAndProof<E> {}
7980
impl SignedObject for SelectionProof {}
8081
impl SignedObject for SyncSelectionProof {}
@@ -599,10 +600,10 @@ mod tests {
599600
.assert_signatures_match("beacon_block_base", |pubkey, validator_store| {
600601
let spec = spec.clone();
601602
async move {
602-
let block = BeaconBlock::Base(BeaconBlockBase::empty(&spec));
603+
let block = BeaconBlock::<E>::Base(BeaconBlockBase::empty(&spec));
603604
let block_slot = block.slot();
604605
validator_store
605-
.sign_block(pubkey, block, block_slot)
606+
.sign_block(pubkey, block.into(), block_slot)
606607
.await
607608
.unwrap()
608609
}
@@ -669,10 +670,10 @@ mod tests {
669670
.assert_signatures_match("beacon_block_altair", |pubkey, validator_store| {
670671
let spec = spec.clone();
671672
async move {
672-
let mut altair_block = BeaconBlockAltair::empty(&spec);
673+
let mut altair_block = BeaconBlockAltair::<E>::empty(&spec);
673674
altair_block.slot = altair_fork_slot;
674675
validator_store
675-
.sign_block(pubkey, BeaconBlock::Altair(altair_block), altair_fork_slot)
676+
.sign_block(pubkey, BeaconBlock::Altair(altair_block).into(), altair_fork_slot)
676677
.await
677678
.unwrap()
678679
}
@@ -752,12 +753,12 @@ mod tests {
752753
.assert_signatures_match("beacon_block_bellatrix", |pubkey, validator_store| {
753754
let spec = spec.clone();
754755
async move {
755-
let mut bellatrix_block = BeaconBlockBellatrix::empty(&spec);
756+
let mut bellatrix_block = BeaconBlockBellatrix::<E>::empty(&spec);
756757
bellatrix_block.slot = bellatrix_fork_slot;
757758
validator_store
758759
.sign_block(
759760
pubkey,
760-
BeaconBlock::Bellatrix(bellatrix_block),
761+
BeaconBlock::Bellatrix(bellatrix_block).into(),
761762
bellatrix_fork_slot,
762763
)
763764
.await
@@ -813,7 +814,7 @@ mod tests {
813814
};
814815

815816
let first_block = || {
816-
let mut bellatrix_block = BeaconBlockBellatrix::empty(&spec);
817+
let mut bellatrix_block = BeaconBlockBellatrix::<E>::empty(&spec);
817818
bellatrix_block.slot = bellatrix_fork_slot;
818819
BeaconBlock::Bellatrix(bellatrix_block)
819820
};
@@ -879,7 +880,7 @@ mod tests {
879880
let block = first_block();
880881
let slot = block.slot();
881882
validator_store
882-
.sign_block(pubkey, block, slot)
883+
.sign_block(pubkey, block.into(), slot)
883884
.await
884885
.unwrap()
885886
})
@@ -890,7 +891,7 @@ mod tests {
890891
let block = double_vote_block();
891892
let slot = block.slot();
892893
validator_store
893-
.sign_block(pubkey, block, slot)
894+
.sign_block(pubkey, block.into(), slot)
894895
.await
895896
.map(|_| ())
896897
},

validator_client/validator_store/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ pub trait ValidatorStore: Send + Sync {
177177
fn proposal_data(&self, pubkey: &PublicKeyBytes) -> Option<ProposalData>;
178178
}
179179

180+
#[derive(Clone, Debug, PartialEq)]
180181
pub enum UnsignedBlock<E: EthSpec> {
181182
Full(BeaconBlock<E>),
182183
Blinded(BlindedBeaconBlock<E>),
@@ -194,6 +195,7 @@ impl<E: EthSpec> From<BlindedBeaconBlock<E>> for UnsignedBlock<E> {
194195
}
195196
}
196197

198+
#[derive(Clone, Debug, PartialEq)]
197199
pub enum SignedBlock<E: EthSpec> {
198200
Full(SignedBeaconBlock<E>),
199201
Blinded(SignedBlindedBeaconBlock<E>),

0 commit comments

Comments
 (0)