mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Fix buld after merge of db branch
This commit is contained in:
parent
3e0b40c248
commit
2a07113074
@ -5,7 +5,7 @@ use crate::{
|
|||||||
WatchForRawTransaction,
|
WatchForRawTransaction,
|
||||||
},
|
},
|
||||||
monero,
|
monero,
|
||||||
monero::{CheckTransfer, CreateWalletForOutput, WatchForTransfer},
|
monero::{CreateWalletForOutput, WatchForTransfer},
|
||||||
serde::{bitcoin_amount, cross_curve_dleq_scalar, monero_private_key},
|
serde::{bitcoin_amount, cross_curve_dleq_scalar, monero_private_key},
|
||||||
transport::{ReceiveMessage, SendMessage},
|
transport::{ReceiveMessage, SendMessage},
|
||||||
};
|
};
|
||||||
|
@ -62,7 +62,7 @@ pub fn init_alice_and_bob_transports() -> (
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn init_test<'a>(
|
pub async fn init_test<'a>(
|
||||||
monero: &'a Monero<'a>,
|
monero: &'a Monero,
|
||||||
bitcoind: &Bitcoind<'a>,
|
bitcoind: &Bitcoind<'a>,
|
||||||
) -> (
|
) -> (
|
||||||
alice::State0,
|
alice::State0,
|
||||||
@ -391,7 +391,7 @@ mod tests {
|
|||||||
.set_default();
|
.set_default();
|
||||||
|
|
||||||
let cli = Cli::default();
|
let cli = Cli::default();
|
||||||
let monero = Monero::new(&cli);
|
let (monero, _container) = Monero::new(&cli);
|
||||||
let bitcoind = init_bitcoind(&cli).await;
|
let bitcoind = init_bitcoind(&cli).await;
|
||||||
let alice_db = harness::storage::Database::open(Path::new(ALICE_TEST_DB_FOLDER)).unwrap();
|
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();
|
let bob_db = harness::storage::Database::open(Path::new(BOB_TEST_DB_FOLDER)).unwrap();
|
||||||
@ -468,21 +468,11 @@ mod tests {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let alice_final_xmr_balance = alice_node
|
let alice_final_xmr_balance = alice_node.monero_wallet.0.get_balance(0).await.unwrap();
|
||||||
.monero_wallet
|
|
||||||
.0
|
|
||||||
.get_balance_alice()
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
bob_node
|
monero.wait_for_bob_wallet_block_height().await.unwrap();
|
||||||
.monero_wallet
|
|
||||||
.0
|
|
||||||
.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!(
|
assert_eq!(
|
||||||
alice_final_btc_balance,
|
alice_final_btc_balance,
|
||||||
|
@ -106,7 +106,7 @@ mod tests {
|
|||||||
async fn recover_state_from_db() {
|
async fn recover_state_from_db() {
|
||||||
let db = Database::open(Path::new("../target/test_recover.db")).unwrap();
|
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_a = cross_curve_dleq::Scalar::random(&mut OsRng);
|
||||||
let s_b = monero::PrivateKey::from_scalar(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);
|
let v_a = xmr_btc::monero::PrivateViewKey::new_random(&mut OsRng);
|
||||||
@ -125,7 +125,7 @@ mod tests {
|
|||||||
S_a_bitcoin,
|
S_a_bitcoin,
|
||||||
v: v_a,
|
v: v_a,
|
||||||
btc: ::bitcoin::Amount::from_sat(100),
|
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_timelock: 0,
|
||||||
refund_address: ::bitcoin::Address::from_str("1L5wSMgerhHg8GZGcsNmAx5EXMRXSKR3He")
|
refund_address: ::bitcoin::Address::from_str("1L5wSMgerhHg8GZGcsNmAx5EXMRXSKR3He")
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
Loading…
Reference in New Issue
Block a user