s/{monero,bitcoin}_ledger/{monero,bitcoin}_client/g

This commit is contained in:
Lucas Soriano del Pino 2020-10-16 14:17:10 +11:00
parent 9d64f3fd29
commit 55ea8f23e2

View File

@ -90,8 +90,8 @@ pub trait MedianTime {
/// signatures have been exchanged. /// signatures have been exchanged.
pub fn action_generator_bob<N, M, B>( pub fn action_generator_bob<N, M, B>(
network: &'static mut N, network: &'static mut N,
monero_ledger: &'static M, monero_client: &'static M,
bitcoin_ledger: &'static B, bitcoin_client: &'static B,
// TODO: Replace this with a new, slimmer struct? // TODO: Replace this with a new, slimmer struct?
bob::State2 { bob::State2 {
A, A,
@ -152,7 +152,7 @@ where
Gen::new_boxed(|co| async move { Gen::new_boxed(|co| async move {
let swap_result: Result<(), SwapFailed> = async { let swap_result: Result<(), SwapFailed> = async {
let btc_has_expired = bitcoin_time_is_gte(bitcoin_ledger, refund_timelock).shared(); let btc_has_expired = bitcoin_time_is_gte(bitcoin_client, refund_timelock).shared();
let poll_until_btc_has_expired = poll_until(btc_has_expired.clone()).shared(); let poll_until_btc_has_expired = poll_until(btc_has_expired.clone()).shared();
futures::pin_mut!(poll_until_btc_has_expired); futures::pin_mut!(poll_until_btc_has_expired);
@ -163,7 +163,7 @@ where
co.yield_(Action::LockBitcoin(tx_lock.clone())).await; co.yield_(Action::LockBitcoin(tx_lock.clone())).await;
match select( match select(
bitcoin_ledger.watch_for_raw_transaction(tx_lock.txid()), bitcoin_client.watch_for_raw_transaction(tx_lock.txid()),
poll_until_btc_has_expired.clone(), poll_until_btc_has_expired.clone(),
) )
.await .await
@ -188,7 +188,7 @@ where
let S = S_a_monero + S_b_monero; let S = S_a_monero + S_b_monero;
match select( match select(
monero_ledger.watch_for_transfer( monero_client.watch_for_transfer(
S, S,
v.public(), v.public(),
transfer_proof, transfer_proof,
@ -213,7 +213,7 @@ where
.await; .await;
let tx_redeem_published = match select( let tx_redeem_published = match select(
bitcoin_ledger.watch_for_raw_transaction(tx_redeem.txid()), bitcoin_client.watch_for_raw_transaction(tx_redeem.txid()),
poll_until_btc_has_expired, poll_until_btc_has_expired,
) )
.await .await
@ -261,7 +261,7 @@ where
co.yield_(Action::CancelBitcoin(signed_tx_cancel)).await; co.yield_(Action::CancelBitcoin(signed_tx_cancel)).await;
let _ = bitcoin_ledger let _ = bitcoin_client
.watch_for_raw_transaction(tx_cancel_txid) .watch_for_raw_transaction(tx_cancel_txid)
.await; .await;
@ -281,7 +281,7 @@ where
co.yield_(Action::RefundBitcoin(signed_tx_refund)).await; co.yield_(Action::RefundBitcoin(signed_tx_refund)).await;
let _ = bitcoin_ledger let _ = bitcoin_client
.watch_for_raw_transaction(tx_refund_txid) .watch_for_raw_transaction(tx_refund_txid)
.await; .await;
} }