Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cylewitruk committed Oct 3, 2024
1 parent 7d0bc51 commit 16ba0b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
14 changes: 9 additions & 5 deletions signer/src/testing/transaction_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ where
C: Context,
{
/// Wait for `expected` instances of the given event `msg`, timing out after `timeout`.
pub async fn wait_for_events(&mut self, msg: TxSignerEvent, expected: u16, timeout: Duration) -> Result<(), Elapsed> {

pub async fn wait_for_events(
&mut self,
msg: TxSignerEvent,
expected: u16,
timeout: Duration,
) -> Result<(), Elapsed> {
let future = async {
let mut n = 0;
loop {
Expand All @@ -112,8 +116,7 @@ where
}
};

tokio::time::timeout(timeout, future)
.await
tokio::time::timeout(timeout, future).await
}
}

Expand Down Expand Up @@ -326,7 +329,8 @@ where
// Wait for the expected number of decisions to be received by each signer.
for handle in event_loop_handles.iter_mut() {
let msg = TxSignerEvent::ReceivedDepositDecision;
handle.wait_for_events(msg, num_expected_decisions, Duration::from_secs(10))
handle
.wait_for_events(msg, num_expected_decisions, Duration::from_secs(10))
.await
.expect("timed out waiting for events");
}
Expand Down
9 changes: 7 additions & 2 deletions signer/src/transaction_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,13 @@ mod tests {
use crate::testing::context::*;

fn test_environment() -> testing::transaction_signer::TestEnvironment<
TestContext<SharedStore, WrappedMock<MockBitcoinInteract>, WrappedMock<MockStacksInteract>, WrappedMock<MockEmilyInteract>,
>> {
TestContext<
SharedStore,
WrappedMock<MockBitcoinInteract>,
WrappedMock<MockStacksInteract>,
WrappedMock<MockEmilyInteract>,
>,
> {
let test_model_parameters = testing::storage::model::Params {
num_bitcoin_blocks: 20,
num_stacks_blocks_per_bitcoin_block: 3,
Expand Down
7 changes: 6 additions & 1 deletion signer/tests/integration/transaction_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ async fn test_environment(
mut signer_connections: Vec<PgStore>,
signing_threshold: u32,
) -> TestEnvironment<
TestContext<PgStore, WrappedMock<MockBitcoinInteract>, WrappedMock<MockStacksInteract>, WrappedMock<MockEmilyInteract>>,
TestContext<
PgStore,
WrappedMock<MockBitcoinInteract>,
WrappedMock<MockStacksInteract>,
WrappedMock<MockEmilyInteract>,
>,
> {
let context_window = 3;

Expand Down

0 comments on commit 16ba0b8

Please sign in to comment.