2020-09-28 02:18:50 -04:00
|
|
|
use monero_harness::Monero;
|
|
|
|
use spectral::prelude::*;
|
|
|
|
use testcontainers::clients::Cli;
|
|
|
|
|
|
|
|
const ALICE_FUND_AMOUNT: u64 = 1_000_000_000_000;
|
|
|
|
const BOB_FUND_AMOUNT: u64 = 0;
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn init_accounts_for_alice_and_bob() {
|
2020-10-19 21:18:27 -04:00
|
|
|
let tc = Cli::default();
|
2020-10-22 20:28:58 -04:00
|
|
|
let (monero, _container) = Monero::new(&tc).unwrap();
|
2020-10-19 21:18:27 -04:00
|
|
|
monero
|
|
|
|
.init(ALICE_FUND_AMOUNT, BOB_FUND_AMOUNT)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2020-09-28 02:18:50 -04:00
|
|
|
|
|
|
|
let got_balance_alice = monero
|
2020-10-19 21:18:27 -04:00
|
|
|
.alice_wallet_rpc_client()
|
|
|
|
.get_balance(0)
|
2020-09-28 02:18:50 -04:00
|
|
|
.await
|
|
|
|
.expect("failed to get alice's balance");
|
|
|
|
|
|
|
|
let got_balance_bob = monero
|
2020-10-19 21:18:27 -04:00
|
|
|
.bob_wallet_rpc_client()
|
|
|
|
.get_balance(0)
|
2020-09-28 02:18:50 -04:00
|
|
|
.await
|
|
|
|
.expect("failed to get bob's balance");
|
|
|
|
|
|
|
|
assert_that!(got_balance_alice).is_equal_to(ALICE_FUND_AMOUNT);
|
|
|
|
assert_that!(got_balance_bob).is_equal_to(BOB_FUND_AMOUNT);
|
|
|
|
}
|