WIP - Add highter order function for test init to solve lifetime issues of cli

This commit is contained in:
Daniel Karzel 2021-01-14 11:02:19 +11:00
parent 9a260df97d
commit 8708d27603
2 changed files with 29 additions and 15 deletions

View file

@ -8,14 +8,10 @@ pub mod testutils;
#[tokio::test]
async fn happy_path() {
let mut test = Test::new(
bitcoin::Amount::from_sat(1_000_000),
monero::Amount::from_piconero(1_000_000_000_000),
)
.await;
testutils::test(|alice, bob| async move {
join!(alice.swap(), bob.swap());
join!(test.alice.swap(), test.bob.swap());
test.alice.assert_btc_redeemed();
test.bob.assert_btc_redeemed();
alice.assert_btc_redeemed();
bob.assert_btc_redeemed();
}).await;
}