mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-07-24 15:25:28 -04:00
WIP - Working on understanding why the docker cli lifetime is a problem
This commit is contained in:
parent
923ab85a86
commit
9a260df97d
1 changed files with 4 additions and 6 deletions
|
@ -26,7 +26,8 @@ impl<'a> Test<'a> {
|
||||||
pub async fn new(btc_to_swap: bitcoin::Amount, xmr_to_swap: monero::Amount) -> Test<'a> {
|
pub async fn new(btc_to_swap: bitcoin::Amount, xmr_to_swap: monero::Amount) -> Test<'a> {
|
||||||
let _guard = init_tracing();
|
let _guard = init_tracing();
|
||||||
|
|
||||||
let (monero, containers) = testutils::init_containers().await;
|
let cli = Cli::default();
|
||||||
|
let (monero, containers) = testutils::init_containers(&cli).await;
|
||||||
|
|
||||||
let bob_btc_starting_balance = btc_to_swap * 10;
|
let bob_btc_starting_balance = btc_to_swap * 10;
|
||||||
let alice_xmr_starting_balance = xmr_to_swap * 10;
|
let alice_xmr_starting_balance = xmr_to_swap * 10;
|
||||||
|
@ -72,21 +73,18 @@ impl<'a> Test<'a> {
|
||||||
// This is just to keep the containers alive
|
// This is just to keep the containers alive
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub struct Containers<'a> {
|
pub struct Containers<'a> {
|
||||||
cli: Cli,
|
|
||||||
pub bitcoind: Bitcoind<'a>,
|
pub bitcoind: Bitcoind<'a>,
|
||||||
pub monerods: Vec<Container<'a, Cli, image::Monero>>,
|
pub monerods: Vec<Container<'a, Cli, image::Monero>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn init_containers<'a>() -> (Monero, Containers<'a>) {
|
pub async fn init_containers<'a>(cli: &'a Cli) -> (Monero, Containers<'a>) {
|
||||||
let cli = Cli::default();
|
let bitcoind = Bitcoind::new(cli, "0.19.1").unwrap();
|
||||||
let bitcoind = Bitcoind::new(&cli, "0.19.1").unwrap();
|
|
||||||
let _ = bitcoind.init(5).await;
|
let _ = bitcoind.init(5).await;
|
||||||
let (monero, monerods) = Monero::new(&cli, None, vec!["alice".to_string(), "bob".to_string()])
|
let (monero, monerods) = Monero::new(&cli, None, vec!["alice".to_string(), "bob".to_string()])
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
(monero, Containers {
|
(monero, Containers {
|
||||||
cli,
|
|
||||||
bitcoind,
|
bitcoind,
|
||||||
monerods,
|
monerods,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue