From 2a07113074fda8964f76ef34c11175584b88243e Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 22 Oct 2020 08:28:51 +1100 Subject: [PATCH] Fix buld after merge of db branch --- xmr-btc/src/bob.rs | 2 +- xmr-btc/tests/e2e.rs | 20 +++++--------------- xmr-btc/tests/harness/storage.rs | 4 ++-- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/xmr-btc/src/bob.rs b/xmr-btc/src/bob.rs index bf8780ea..d106e915 100644 --- a/xmr-btc/src/bob.rs +++ b/xmr-btc/src/bob.rs @@ -5,7 +5,7 @@ use crate::{ WatchForRawTransaction, }, monero, - monero::{CheckTransfer, CreateWalletForOutput, WatchForTransfer}, + monero::{CreateWalletForOutput, WatchForTransfer}, serde::{bitcoin_amount, cross_curve_dleq_scalar, monero_private_key}, transport::{ReceiveMessage, SendMessage}, }; diff --git a/xmr-btc/tests/e2e.rs b/xmr-btc/tests/e2e.rs index d2e5f550..84f0878a 100644 --- a/xmr-btc/tests/e2e.rs +++ b/xmr-btc/tests/e2e.rs @@ -62,7 +62,7 @@ pub fn init_alice_and_bob_transports() -> ( } pub async fn init_test<'a>( - monero: &'a Monero<'a>, + monero: &'a Monero, bitcoind: &Bitcoind<'a>, ) -> ( alice::State0, @@ -391,7 +391,7 @@ mod tests { .set_default(); let cli = Cli::default(); - let monero = Monero::new(&cli); + let (monero, _container) = Monero::new(&cli); let bitcoind = init_bitcoind(&cli).await; let alice_db = harness::storage::Database::open(Path::new(ALICE_TEST_DB_FOLDER)).unwrap(); let bob_db = harness::storage::Database::open(Path::new(BOB_TEST_DB_FOLDER)).unwrap(); @@ -468,21 +468,11 @@ mod tests { .await .unwrap(); - let alice_final_xmr_balance = alice_node - .monero_wallet - .0 - .get_balance_alice() - .await - .unwrap(); + let alice_final_xmr_balance = alice_node.monero_wallet.0.get_balance(0).await.unwrap(); - bob_node - .monero_wallet - .0 - .wait_for_bob_wallet_block_height() - .await - .unwrap(); + monero.wait_for_bob_wallet_block_height().await.unwrap(); - let bob_final_xmr_balance = bob_node.monero_wallet.0.get_balance_bob().await.unwrap(); + let bob_final_xmr_balance = bob_node.monero_wallet.0.get_balance(0).await.unwrap(); assert_eq!( alice_final_btc_balance, diff --git a/xmr-btc/tests/harness/storage.rs b/xmr-btc/tests/harness/storage.rs index 19b1b401..1f2947cb 100644 --- a/xmr-btc/tests/harness/storage.rs +++ b/xmr-btc/tests/harness/storage.rs @@ -106,7 +106,7 @@ mod tests { async fn recover_state_from_db() { let db = Database::open(Path::new("../target/test_recover.db")).unwrap(); - let a = crate::bitcoin::SecretKey::new_random(&mut OsRng); + let a = xmr_btc::bitcoin::SecretKey::new_random(&mut OsRng); let s_a = cross_curve_dleq::Scalar::random(&mut OsRng); let s_b = monero::PrivateKey::from_scalar(Scalar::random(&mut OsRng)); let v_a = xmr_btc::monero::PrivateViewKey::new_random(&mut OsRng); @@ -125,7 +125,7 @@ mod tests { S_a_bitcoin, v: v_a, btc: ::bitcoin::Amount::from_sat(100), - xmr: crate::monero::Amount::from_piconero(1000), + xmr: xmr_btc::monero::Amount::from_piconero(1000), refund_timelock: 0, refund_address: ::bitcoin::Address::from_str("1L5wSMgerhHg8GZGcsNmAx5EXMRXSKR3He") .unwrap(),