Make swap e2e test work with new monerod lib

This commit is contained in:
Philipp Hoenisch 2020-11-03 12:13:18 +11:00
parent 70d64f74ae
commit 981fcacc95
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666

View File

@ -51,11 +51,21 @@ mod e2e_test {
.await .await
.unwrap(); .unwrap();
let (monero, _container) = Monero::new(&cli).unwrap(); let (monero, _container) = Monero::new(&cli, Some("swap_".to_string()), vec![
monero.init(xmr_alice, xmr_bob).await.unwrap(); "alice".to_string(),
"bob".to_string(),
])
.await
.unwrap();
monero
.init(vec![("alice", xmr_alice), ("bob", xmr_bob)])
.await
.unwrap();
let alice_xmr_wallet = Arc::new(swap::monero::Wallet(monero.alice_wallet_rpc_client())); let alice_xmr_wallet = Arc::new(swap::monero::Wallet(
let bob_xmr_wallet = Arc::new(swap::monero::Wallet(monero.bob_wallet_rpc_client())); monero.wallet("alice").unwrap().client(),
));
let bob_xmr_wallet = Arc::new(swap::monero::Wallet(monero.wallet("bob").unwrap().client()));
let alice_behaviour = alice::Alice::default(); let alice_behaviour = alice::Alice::default();
let alice_transport = build(alice_behaviour.identity()).unwrap(); let alice_transport = build(alice_behaviour.identity()).unwrap();
@ -92,7 +102,7 @@ mod e2e_test {
let xmr_alice_final = alice_xmr_wallet.as_ref().get_balance().await.unwrap(); let xmr_alice_final = alice_xmr_wallet.as_ref().get_balance().await.unwrap();
monero.wait_for_bob_wallet_block_height().await.unwrap(); bob_xmr_wallet.as_ref().0.refresh().await.unwrap();
let xmr_bob_final = bob_xmr_wallet.as_ref().get_balance().await.unwrap(); let xmr_bob_final = bob_xmr_wallet.as_ref().get_balance().await.unwrap();
assert_eq!( assert_eq!(