Skip to content

Commit

Permalink
Fix reshare test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoticTempest committed Oct 4, 2024
1 parent e56228b commit 82de098
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions chain-signatures/contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ impl VersionedMpcContract {
join_votes,
..
}) => {
log!("voting for {candidate:?} in {candidates:?}");
let candidate_info = candidates
.get(&candidate)
.ok_or(VoteError::JoinNotCandidate)?;
Expand Down
5 changes: 2 additions & 3 deletions chain-signatures/node/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,8 @@ pub fn run(

let Ok(lake) = rt.block_on(async {
let latest = context.indexer.latest_block_height().await;
if i > 0 {
tracing::warn!("indexer latest height {latest}, restart count={i}");
}
tracing::info!("indexer latest height {latest}");

let mut lake_builder = LakeBuilder::default()
.s3_bucket_name(&options.s3_bucket)
.s3_region_name(&options.s3_region)
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/chain-signatures/tests/cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn test_multichain_reshare() -> anyhow::Result<()> {
actions::single_signature_production(&ctx, &state).await?;

tracing::info!("!!! Add participant 3");
assert!(ctx.add_participant(None).await.is_ok());
ctx.add_participant(None).await.unwrap();
let state = wait_for::running_mpc(&ctx, None).await?;
wait_for::has_at_least_triples(&ctx, 2).await?;
wait_for::has_at_least_presignatures(&ctx, 2).await?;
Expand All @@ -39,7 +39,7 @@ async fn test_multichain_reshare() -> anyhow::Result<()> {
state.participants.keys().nth(2).unwrap().clone().as_ref(),
)
.unwrap();
assert!(ctx.remove_participant(Some(&account_2)).await.is_ok());
ctx.remove_participant(Some(&account_2)).await.unwrap();
let account_0 = near_workspaces::types::AccountId::from_str(
state.participants.keys().next().unwrap().clone().as_ref(),
)
Expand All @@ -63,7 +63,7 @@ async fn test_multichain_reshare() -> anyhow::Result<()> {
actions::single_signature_production(&ctx, &state).await?;

tracing::info!("!!! Add back participant 0");
assert!(ctx.add_participant(Some(node_cfg_0)).await.is_ok());
ctx.add_participant(Some(node_cfg_0)).await.unwrap();
let state = wait_for::running_mpc(&ctx, None).await?;
wait_for::has_at_least_triples(&ctx, 2).await?;
wait_for::has_at_least_presignatures(&ctx, 2).await?;
Expand Down
5 changes: 3 additions & 2 deletions integration-tests/chain-signatures/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl MultichainTestContext<'_> {

self.nodes.start_node(&self.cfg, &node_account).await?;
// Wait for new node to add itself as a candidate
tokio::time::sleep(tokio::time::Duration::from_secs(10)).await;
tokio::time::sleep(tokio::time::Duration::from_secs(20)).await;

// T number of participants should vote
let participants = self.participant_accounts().await?;
Expand All @@ -76,7 +76,8 @@ impl MultichainTestContext<'_> {
node_account.id(),
self.cfg.threshold,
)
.await?;
.await
.unwrap();

let new_state = wait_for::running_mpc(self, Some(state.epoch + 1)).await?;
assert_eq!(new_state.participants.len(), state.participants.len() + 1);
Expand Down

0 comments on commit 82de098

Please sign in to comment.