Skip to content

Commit

Permalink
Merge pull request #1312 from fluidvanadium/from_map_err
Browse files Browse the repository at this point in the history
From map err
  • Loading branch information
zancas authored Jul 27, 2024
2 parents 031c92a + 366ed2f commit 7dbc469
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions zingolib/src/lightclient/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub mod send_with_proposal {
UnifiedSpendKey(std::io::Error),
#[error("Can't Calculate {0:?}")]
Calculation(
#[from]
zcash_client_backend::data_api::error::Error<
crate::wallet::tx_map_and_maybe_trees::TxMapAndMaybeTreesTraitError,
std::convert::Infallible,
Expand All @@ -77,7 +78,7 @@ pub mod send_with_proposal {

#[allow(missing_docs)] // error types document themselves
#[derive(Debug, Error)]
pub enum CompleteAndBroadcastStoredProposal {
pub enum CompleteAndBroadcastStoredProposalError {
#[error("No proposal. Call do_propose first.")]
NoStoredProposal,
#[error("send {0:?}")]
Expand Down Expand Up @@ -177,8 +178,7 @@ pub mod send_with_proposal {
step,
Some(usk_to_tkey),
Some(self.wallet.wallet_capability().first_sapling_address()),
)
.map_err(CompleteAndBroadcastError::Calculation)?;
)?;

let result = self
.wallet
Expand Down Expand Up @@ -211,7 +211,7 @@ pub mod send_with_proposal {
/// Calculates, signs and broadcasts transactions from a stored proposal.
pub async fn complete_and_broadcast_stored_proposal(
&self,
) -> Result<NonEmpty<TxId>, CompleteAndBroadcastStoredProposal> {
) -> Result<NonEmpty<TxId>, CompleteAndBroadcastStoredProposalError> {
if let Some(proposal) = self.latest_proposal.read().await.as_ref() {
match proposal {
crate::lightclient::ZingoProposal::Transfer(transfer_proposal) => {
Expand All @@ -223,9 +223,9 @@ pub mod send_with_proposal {
.await
}
}
.map_err(CompleteAndBroadcastStoredProposal::CompleteAndBroadcast)
.map_err(CompleteAndBroadcastStoredProposalError::CompleteAndBroadcast)
} else {
Err(CompleteAndBroadcastStoredProposal::NoStoredProposal)
Err(CompleteAndBroadcastStoredProposalError::NoStoredProposal)
}
}

Expand Down

0 comments on commit 7dbc469

Please sign in to comment.