mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-13 00:19:31 -05:00
50ed74319f
- Make it the same for Alice and Bob. - Make it contain a wallet client instead of the `Monero` struct. Also: Remove `Container` from inside `Monero` struct. The caller of `new` can simply ensure that `Container` is not dropped to keep the container alive. This makes the `Monero` struct easier to work with, as it just holds the data necessary to create the different clients created during `init`, and does not have any lifetime restrictions.
22 lines
467 B
Rust
22 lines
467 B
Rust
use monero_harness::Monero;
|
|
use spectral::prelude::*;
|
|
use testcontainers::clients::Cli;
|
|
|
|
fn init_cli() -> Cli {
|
|
Cli::default()
|
|
}
|
|
|
|
#[tokio::test]
|
|
async fn connect_to_monerod() {
|
|
let tc = init_cli();
|
|
let (monero, _container) = Monero::new(&tc);
|
|
let cli = monero.monerod_rpc_client();
|
|
|
|
let header = cli
|
|
.get_block_header_by_height(0)
|
|
.await
|
|
.expect("failed to get block 0");
|
|
|
|
assert_that!(header.height).is_equal_to(0);
|
|
}
|