Skip to content

Commit 9b0ee53

Browse files
committed
fix tests
1 parent c97918f commit 9b0ee53

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testing/web3signer_tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ edition = { workspace = true }
1010
account_utils = { workspace = true }
1111
async-channel = { workspace = true }
1212
environment = { workspace = true }
13+
eth2 = { workspace = true }
1314
eth2_keystore = { workspace = true }
1415
eth2_network_config = { workspace = true }
1516
futures = { workspace = true }

testing/web3signer_tests/src/lib.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod tests {
2020
use account_utils::validator_definitions::{
2121
SigningDefinition, ValidatorDefinition, ValidatorDefinitions, Web3SignerDefinition,
2222
};
23+
use eth2::types::FullBlockContents;
2324
use eth2_keystore::KeystoreBuilder;
2425
use eth2_network_config::Eth2NetworkConfig;
2526
use initialized_validators::{
@@ -45,7 +46,9 @@ mod tests {
4546
use tokio::time::sleep;
4647
use types::{attestation::AttestationBase, *};
4748
use url::Url;
48-
use validator_store::{Error as ValidatorStoreError, SignedBlock, ValidatorStore};
49+
use validator_store::{
50+
Error as ValidatorStoreError, SignedBlock, UnsignedBlock, ValidatorStore,
51+
};
4952

5053
/// If the we are unable to reach the Web3Signer HTTP API within this time out then we will
5154
/// assume it failed to start.
@@ -595,8 +598,9 @@ mod tests {
595598
async move {
596599
let block = BeaconBlock::<E>::Base(BeaconBlockBase::empty(&spec));
597600
let block_slot = block.slot();
601+
let unsigned_block = UnsignedBlock::Full(FullBlockContents::Block(block));
598602
validator_store
599-
.sign_block(pubkey, block.into(), block_slot)
603+
.sign_block(pubkey, unsigned_block, block_slot)
600604
.await
601605
.unwrap()
602606
}
@@ -665,12 +669,10 @@ mod tests {
665669
async move {
666670
let mut altair_block = BeaconBlockAltair::empty(&spec);
667671
altair_block.slot = altair_fork_slot;
672+
let unsigned_block =
673+
UnsignedBlock::Full(FullBlockContents::Block(altair_block.into()));
668674
validator_store
669-
.sign_block(
670-
pubkey,
671-
BeaconBlock::<E>::Altair(altair_block).into(),
672-
altair_fork_slot,
673-
)
675+
.sign_block(pubkey, unsigned_block, altair_fork_slot)
674676
.await
675677
.unwrap()
676678
}
@@ -752,12 +754,10 @@ mod tests {
752754
async move {
753755
let mut bellatrix_block = BeaconBlockBellatrix::empty(&spec);
754756
bellatrix_block.slot = bellatrix_fork_slot;
757+
let unsigned_block =
758+
UnsignedBlock::Full(FullBlockContents::Block(bellatrix_block.into()));
755759
validator_store
756-
.sign_block(
757-
pubkey,
758-
BeaconBlock::<E>::Bellatrix(bellatrix_block).into(),
759-
bellatrix_fork_slot,
760-
)
760+
.sign_block(pubkey, unsigned_block, bellatrix_fork_slot)
761761
.await
762762
.unwrap()
763763
}
@@ -876,8 +876,9 @@ mod tests {
876876
.assert_signatures_match("first_block", |pubkey, validator_store| async move {
877877
let block = first_block();
878878
let slot = block.slot();
879+
let unsigned_block = UnsignedBlock::Full(FullBlockContents::Block(block));
879880
validator_store
880-
.sign_block(pubkey, block.into(), slot)
881+
.sign_block(pubkey, unsigned_block, slot)
881882
.await
882883
.unwrap()
883884
})
@@ -887,8 +888,9 @@ mod tests {
887888
move |pubkey, validator_store| async move {
888889
let block = double_vote_block();
889890
let slot = block.slot();
891+
let unsigned_block = UnsignedBlock::Full(FullBlockContents::Block(block));
890892
validator_store
891-
.sign_block(pubkey, block.into(), slot)
893+
.sign_block(pubkey, unsigned_block, slot)
892894
.await
893895
.map(|_| ())
894896
},

0 commit comments

Comments
 (0)