You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wow-btc-swap/monero-harness/tests/monerod.rs

32 lines
904 B

use crate::testutils::init_tracing;
use monero_harness::Monero;
use spectral::prelude::*;
4 years ago
use std::time::Duration;
use testcontainers::clients::Cli;
4 years ago
use tokio::time;
mod testutils;
#[tokio::test]
4 years ago
async fn init_miner_and_mine_to_miner_address() {
let _guard = init_tracing();
4 years ago
let tc = Cli::default();
let (monero, _monerod_container) = Monero::new(&tc, vec![]).await.unwrap();
4 years ago
monero.init(vec![]).await.unwrap();
let monerod = monero.monerod();
let miner_wallet = monero.wallet("miner").unwrap();
4 years ago
let got_miner_balance = miner_wallet.balance().await.unwrap();
4 years ago
assert_that!(got_miner_balance).is_greater_than(0);
time::sleep(Duration::from_millis(1010)).await;
4 years ago
// after a bit more than 1 sec another block should have been mined
let block_height = monerod.client().get_block_count().await.unwrap();
4 years ago
assert_that(&block_height).is_greater_than(70);
}