Skip to content

Commit

Permalink
succumb to the siren call of 'use'
Browse files Browse the repository at this point in the history
  • Loading branch information
zancas committed May 6, 2024
1 parent f861ccb commit 8a73d3c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions zingolib/src/lightclient/propose.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! LightClient function do_propose generates a proposal to send to specified addresses.
use crate::{
data::proposal::ZingoProposal,
lightclient::LightClient,
wallet::tx_map_and_maybe_trees::{TxMapAndMaybeTrees, TxMapAndMaybeTreesTraitError},
};
Expand Down Expand Up @@ -169,10 +170,8 @@ impl LightClient {
)
.map_err(DoProposeError::Proposal)?;

self.update_latest_proposal(crate::data::proposal::ZingoProposal::Transfer(
proposal.clone(),
))
.await;
self.update_latest_proposal(ZingoProposal::Transfer(proposal.clone()))
.await;
Ok(proposal)
}

Expand Down Expand Up @@ -245,14 +244,12 @@ impl LightClient {
)
.map_err(DoProposeError::ShieldProposal)?;

self.update_latest_proposal(crate::data::proposal::ZingoProposal::Shield(
proposed_shield.clone(),
))
.await;
self.update_latest_proposal(ZingoProposal::Shield(proposed_shield.clone()))
.await;
Ok(proposed_shield)
}
/// A helper method that standardizes latest_proposal update
async fn update_latest_proposal(&self, proposal: crate::data::proposal::ZingoProposal) {
async fn update_latest_proposal(&self, proposal: ZingoProposal) {
*(self.latest_proposal.write().await) = Some(proposal.clone());
}
}
Expand Down

0 comments on commit 8a73d3c

Please sign in to comment.