Fix build after merge

pull/12/head
Tobin C. Harding 4 years ago
parent f8adf6d7e0
commit 97363cb05c

@ -4,12 +4,9 @@ use backoff::{future::FutureOperation as _, ExponentialBackoff};
use bitcoin::{util::psbt::PartiallySignedTransaction, Address, Transaction};
use bitcoin_harness::bitcoind_rpc::PsbtBase64;
use reqwest::Url;
use xmr_btc::{
bitcoin::{
Amount, BroadcastSignedTransaction, BuildTxLockPsbt, SignTxLock, TxLock, Txid,
WatchForRawTransaction,
},
MedianTime,
use xmr_btc::bitcoin::{
Amount, BroadcastSignedTransaction, BuildTxLockPsbt, SignTxLock, TxLock, Txid,
WatchForRawTransaction,
};
// This is cut'n'paste from xmr_btc/tests/harness/wallet/bitcoin.rs
@ -100,16 +97,3 @@ impl WatchForRawTransaction for Wallet {
.expect("transient errors to be retried")
}
}
#[async_trait]
impl MedianTime for Wallet {
async fn median_time(&self) -> u32 {
(|| async { Ok(self.0.median_time().await?) })
.retry(ExponentialBackoff {
max_elapsed_time: None,
..Default::default()
})
.await
.expect("transient errors to be retried")
}
}

@ -8,8 +8,11 @@ mod tests {
use crate::{
harness,
harness::node::{run_alice_until, run_bob_until},
init_bitcoind, init_test, ALICE_TEST_DB_FOLDER, BOB_TEST_DB_FOLDER,
harness::{
init_bitcoind, init_test,
node::{run_alice_until, run_bob_until},
ALICE_TEST_DB_FOLDER, BOB_TEST_DB_FOLDER,
},
};
use futures::future;
use monero_harness::Monero;
@ -258,7 +261,7 @@ mod tests {
mut bob_node,
initial_balances,
swap_amounts,
) = init_test(&monero, &bitcoind).await;
) = init_test(&monero, &bitcoind, None, None).await;
{
let (alice_state, bob_state) = future::try_join(
@ -341,13 +344,13 @@ mod tests {
assert_eq!(
alice_final_xmr_balance,
initial_balances.alice_xmr
- u64::from(swap_amounts.xmr)
- u64::from(alice_state6.lock_xmr_fee())
initial_balances.alice_xmr.as_piconero()
- swap_amounts.xmr.as_piconero()
- alice_state6.lock_xmr_fee().as_piconero()
);
assert_eq!(
bob_final_xmr_balance,
initial_balances.bob_xmr + u64::from(swap_amounts.xmr)
initial_balances.bob_xmr.as_piconero() + swap_amounts.xmr.as_piconero()
);
}
}

@ -59,6 +59,8 @@ use xmr_btc::{bitcoin, monero};
const TEN_XMR: u64 = 10_000_000_000_000;
const RELATIVE_REFUND_TIMELOCK: u32 = 1;
const RELATIVE_PUNISH_TIMELOCK: u32 = 1;
pub const ALICE_TEST_DB_FOLDER: &str = "../target/e2e-test-alice-recover";
pub const BOB_TEST_DB_FOLDER: &str = "../target/e2e-test-bob-recover";
pub async fn init_bitcoind(tc_client: &Cli) -> Bitcoind<'_> {
let bitcoind = Bitcoind::new(tc_client, "0.19.1").expect("failed to create bitcoind");

Loading…
Cancel
Save