use std::convert::Infallible;
use pepper_sync::error::SyncModeError;
use crate::wallet::{
error::{
CalculateTransactionError, ProposeSendError, ProposeShieldError, TransmissionError,
WalletError,
},
output::OutputRef,
};
#[derive(Debug, thiserror::Error)]
pub enum LightClientError {
#[error("No sync handle. Sync is not running.")]
SyncNotRunning,
#[error("Sync error. {0}")]
SyncError(#[from] pepper_sync::error::SyncError<WalletError>),
#[error("sync mode error. {0}")]
SyncModeError(#[from] SyncModeError),
#[error("gRPC client error. {0}")]
ClientError(#[from] zingo_netutils::GetClientError),
#[error("File error. {0}")]
FileError(#[from] std::io::Error),
#[error("Wallet error. {0}")]
WalletError(#[from] WalletError),
#[error("Tor client error. {0}")]
TorClientError(#[from] zcash_client_backend::tor::Error),
}
#[allow(missing_docs)] #[derive(Debug, thiserror::Error)]
pub enum SendError {
#[error("The sending transaction could not be calculated. {0}")]
CalculateSendError(CalculateTransactionError<OutputRef>),
#[error("The shieldng transaction could not be calculated. {0}")]
CalculateShieldError(CalculateTransactionError<Infallible>),
#[error("Transmission failed. {0}")]
TransmissionError(#[from] TransmissionError),
#[error("No proposal found.")]
NoStoredProposal,
}
#[allow(missing_docs)] #[derive(Debug, thiserror::Error)]
pub enum QuickSendError {
#[error("proposal failed. {0}")]
ProposalError(#[from] ProposeSendError),
#[error("send failed. {0}")]
SendError(#[from] SendError),
}
#[allow(missing_docs)] #[derive(Debug, thiserror::Error)]
pub enum QuickShieldError {
#[error("proposal failed. {0}")]
ProposalError(#[from] ProposeShieldError),
#[error("send failed. {0}")]
SendError(#[from] SendError),
}