2021-01-21 17:09:53 +11:00
|
|
|
pub mod testutils;
|
|
|
|
|
2021-02-09 11:15:55 +11:00
|
|
|
use swap::protocol::bob;
|
2021-01-27 17:03:52 +11:00
|
|
|
use testutils::SlowCancelConfig;
|
2020-12-14 17:24:23 +11:00
|
|
|
|
|
|
|
/// Run the following tests with RUST_MIN_STACK=10000000
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn happy_path() {
|
2021-01-29 13:52:05 +11:00
|
|
|
testutils::setup_test(SlowCancelConfig, |mut ctx| async move {
|
2021-01-22 13:33:31 +11:00
|
|
|
let (bob_swap, _) = ctx.new_swap_as_bob().await;
|
2021-01-15 19:34:51 +11:00
|
|
|
|
2021-02-09 11:15:55 +11:00
|
|
|
let bob_state = bob::run(bob_swap).await;
|
2021-01-22 13:33:31 +11:00
|
|
|
|
2021-02-09 11:15:55 +11:00
|
|
|
ctx.assert_alice_redeemed().await;
|
2021-01-20 10:40:40 +11:00
|
|
|
ctx.assert_bob_redeemed(bob_state.unwrap()).await;
|
2021-01-15 11:26:32 +11:00
|
|
|
})
|
2020-12-14 17:24:23 +11:00
|
|
|
.await;
|
|
|
|
}
|