Skip to content

Commit

Permalink
Remove sleeps
Browse files Browse the repository at this point in the history
  • Loading branch information
ktdlr committed Oct 21, 2024
1 parent bd79b83 commit 596f8ed
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,19 +390,18 @@ async fn test_stopped_keyshares_retain_state() -> Result<()> {
let cn2 = setup_local_ciphernode(&bus, &rng, true, &eth_addrs[1], None).await?;
add_ciphernodes(&bus, &eth_addrs).await?;

sleep(Duration::from_millis(1)).await;

// Send e3request
let e3_request_event = EnclaveEvent::from(E3Requested {
e3_id: e3_id.clone(),
threshold_m: 2,
seed: seed.clone(),
params: params.to_bytes(),
src_chain_id: 1,
});
bus.send(e3_request_event.clone()).await?;

sleep(Duration::from_millis(1)).await;
bus.send(
EnclaveEvent::from(E3Requested {
e3_id: e3_id.clone(),
threshold_m: 2,
seed: seed.clone(),
params: params.to_bytes(),
src_chain_id: 1,
})
.clone(),
)
.await?;

let history = bus.send(GetHistory).await?;

Expand All @@ -411,7 +410,6 @@ async fn test_stopped_keyshares_retain_state() -> Result<()> {

// Reset history
bus.send(ResetHistory).await?;
sleep(Duration::from_millis(1)).await;

// Check event count is correct
assert_eq!(history.len(), 7);
Expand All @@ -436,9 +434,9 @@ async fn test_stopped_keyshares_retain_state() -> Result<()> {
})
.aggregate()?;

// Publish the ciphertext
let raw_plaintext = vec![1234u64, 873827u64];
let (ciphertext, expected) = encrypt_ciphertext(&params, pubkey, raw_plaintext)?;

bus.send(
EnclaveEvent::from(CiphertextOutputPublished {
ciphertext_output: ciphertext.to_bytes(),
Expand All @@ -448,8 +446,6 @@ async fn test_stopped_keyshares_retain_state() -> Result<()> {
)
.await?;

sleep(Duration::from_millis(1)).await;

let history = bus.send(GetHistory).await?;

let actual = history.iter().find_map(|evt| match evt {
Expand Down

0 comments on commit 596f8ed

Please sign in to comment.