Refactor monero::Wallet::watch_for_transfer to not use backoff

Instead, we use a regular loop and extract everything into a function
that can be independently tested.
`backoff` would be useful to retry the actual call to the node.
This commit is contained in:
Thomas Eizinger 2021-03-11 16:06:28 +11:00
parent f0a2134f76
commit 82738b111e
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
4 changed files with 182 additions and 62 deletions

View file

@ -359,6 +359,7 @@ where
electrs_rpc_port,
electrs_http_port,
alice_seed,
execution_params,
)
.await;
@ -381,6 +382,7 @@ where
electrs_rpc_port,
electrs_http_port,
bob_seed,
execution_params,
)
.await;
@ -590,6 +592,7 @@ async fn init_test_wallets(
electrum_rpc_port: u16,
electrum_http_port: u16,
seed: Seed,
execution_params: ExecutionParams,
) -> (Arc<bitcoin::Wallet>, Arc<monero::Wallet>) {
monero
.init(vec![(name, starting_balances.xmr.as_piconero())])
@ -600,6 +603,7 @@ async fn init_test_wallets(
monero.wallet(name).unwrap().client(),
monero::Network::default(),
name.to_string(),
execution_params,
);
let electrum_rpc_url = {