Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update client/rpc-spec-v2/src/chain_head/test_utils.rs
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
lexnv and bkchr authored Mar 23, 2023
commit ab28f73fa665a1299f180fb64ebfd999a172cbde
6 changes: 2 additions & 4 deletions client/rpc-spec-v2/src/chain_head/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ impl<Client> ChainHeadMockClient<Client> {

pub async fn trigger_finality_stream(&self, header: Header) {
// Ensure the client called the `finality_notification_stream`.
let mut retries = NUM_RETRIES;
while retries > 0 && self.finality_sinks.lock().is_empty() {
retries -= 1;
tokio::time::sleep(tokio::time::Duration::from_secs(SLEEP_SECS)).await;
while self.finality_sinks.lock().is_empty() {
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
}

// Build the notification.
Expand Down