Skip to main content

zcash_client_backend/data_api/
error.rs

1//! Types for wallet error handling.
2
3use std::{
4    collections::HashMap,
5    error,
6    fmt::{self, Debug, Display, Write},
7    hash::Hash,
8};
9
10use shardtree::error::ShardTreeError;
11use zcash_address::ConversionError;
12use zcash_keys::address::UnifiedAddress;
13use zcash_primitives::transaction::builder;
14use zcash_protocol::{
15    PoolType,
16    consensus::BlockHeight,
17    value::{BalanceError, Zatoshis},
18};
19
20use crate::{
21    data_api::wallet::input_selection::InputSelectorError, fees::ChangeError,
22    proposal::ProposalError, wallet::NoteId,
23};
24
25#[cfg(feature = "transparent-inputs")]
26use ::transparent::address::TransparentAddress;
27
28/// Errors that can occur as a consequence of wallet operations.
29#[derive(Debug)]
30#[non_exhaustive]
31pub enum Error<DataSourceError, CommitmentTreeError, SelectionError, FeeError, ChangeErrT, NoteRefT>
32{
33    /// An error occurred retrieving data from the underlying data source
34    DataSource(DataSourceError),
35
36    /// An error in computations involving the note commitment trees.
37    CommitmentTree(ShardTreeError<CommitmentTreeError>),
38
39    /// An error in note selection
40    NoteSelection(SelectionError),
41
42    /// An error in change selection during transaction proposal construction
43    Change(ChangeError<ChangeErrT, NoteRefT>),
44
45    /// An error in transaction proposal construction
46    Proposal(ProposalError),
47
48    /// The proposal was structurally valid, but tried to do one of these unsupported things:
49    /// * spend a prior shielded output;
50    /// * pay to an output pool for which the corresponding feature is not enabled;
51    /// * pay to a TEX address if the "transparent-inputs" feature is not enabled.
52    /// * a proposal step has no inputs
53    ProposalNotSupported,
54
55    /// No account could be found corresponding to a provided ID.
56    AccountIdNotRecognized,
57
58    /// No account could be found corresponding to a provided spending key.
59    KeyNotRecognized,
60
61    /// The given account cannot be used for spending, because it is unable to maintain an
62    /// accurate balance.
63    AccountCannotSpend,
64
65    /// Zcash amount computation encountered an overflow or underflow.
66    BalanceError(BalanceError),
67
68    /// Unable to create a new spend because the wallet balance is not sufficient.
69    InsufficientFunds {
70        available: Zatoshis,
71        required: Zatoshis,
72    },
73
74    /// The wallet must scan more of the chain before it can perform the operation.
75    ///
76    /// A proposal returns this error when the wallet has no anchor for the transaction, that is,
77    /// when [`WalletRead::get_target_and_anchor_heights`] returns `None`. This occurs when the
78    /// chain tip is unknown, and while the wallet scans the blocks it missed when it was offline
79    /// for `min_confirmations` blocks or more.
80    ///
81    /// [`WalletRead::get_target_and_anchor_heights`]: crate::data_api::WalletRead::get_target_and_anchor_heights
82    ScanRequired,
83
84    /// An error occurred building a new transaction.
85    Builder(builder::Error<FeeError>),
86
87    /// An error occurred constructing a payment for the transaction.
88    Payment(zip321::PaymentError),
89
90    /// Attempted to send change to an unsupported pool.
91    ///
92    /// This is indicative of a programming error; execution of a transaction proposal that
93    /// presumes support for the specified pool was performed using an application that does not
94    /// provide such support.
95    UnsupportedChangeType(PoolType),
96
97    /// Attempted to create a spend to an unsupported Unified Address receiver
98    NoSupportedReceivers(Box<UnifiedAddress>),
99
100    /// A proposed transaction cannot be built because it requires spending an input of
101    /// a type for which a key required to construct the transaction is not available.
102    KeyNotAvailable(PoolType),
103
104    /// A note being spent does not correspond to either the internal or external
105    /// full viewing key for an account.
106    NoteMismatch(NoteId),
107
108    /// An error occurred parsing the address from a payment request.
109    Address(ConversionError<&'static str>),
110
111    /// The address associated with a record being inserted was not recognized as
112    /// belonging to the wallet.
113    #[cfg(feature = "transparent-inputs")]
114    AddressNotRecognized(TransparentAddress),
115
116    /// The caller requested a nonzero target expiry height below the proposal's
117    /// minimum target height. Zero remains valid because it disables expiry.
118    ExpiryHeightBelowTargetHeight {
119        expiry_height: BlockHeight,
120        min_target_height: BlockHeight,
121    },
122
123    /// The caller requested an expiry height for a step that is a canonical ZIP 318 crossing.
124    ///
125    /// Such a step takes its expiry from the ZIP 318 rolling window, which every crossing in the
126    /// same period shares; a caller-chosen expiry would single it out and undo the shape the
127    /// unpadded bundle and bucketed anchor were chosen to produce. Those are already fixed by the
128    /// time the transaction is built, so the conflict is reported rather than silently resolved.
129    /// Pass `None` to accept the canonical expiry.
130    ExpiryHeightConflictsWithCanonicalCrossing { requested: BlockHeight },
131
132    /// A ZIP 316 Revision 2 recipient address of the payment at the given index has
133    /// expired, or has expiry metadata that conflicts with the transaction's expiry
134    /// height. A currently-valid address should be obtained for the intended recipient.
135    RecipientAddressExpiry {
136        payment_index: usize,
137        error: AddressExpiryError,
138    },
139
140    /// An error occurred while working with PCZTs.
141    #[cfg(feature = "pczt")]
142    Pczt(PcztError),
143}
144
145/// Errors that may occur when rewinding the wallet to a previous chain state.
146#[non_exhaustive]
147pub enum RewindError<AccountId: Hash + Eq, E> {
148    /// An error occurred retrieving data from the underlying data source.
149    DataSource(E),
150    /// Every account in the wallet has a birthday height greater than the height to which any
151    /// reset birthday would be lowered (the chain state's block height plus one), and the
152    /// `reset_account_birthdays` argument supplied by the caller was empty. So long as at
153    /// least one account already has a birthday at or below the new birthday floor, the
154    /// rewind proceeds without lowering any birthdays even when `reset_account_birthdays` is
155    /// empty. The caller should re-try the rewind, providing a non-empty set of accounts
156    /// whose birthday metadata should be lowered to the new birthday floor.
157    ///
158    /// The reported map contains every account in the wallet along with its existing birthday
159    /// height. The caller may include any subset of these in the next call's
160    /// `reset_account_birthdays`; accounts not included will retain their existing birthday
161    /// metadata. (Rescanning of any blocks above the rewind target is performed against all
162    /// wallet viewing keys regardless of which accounts' birthday metadata is reset.)
163    RewindBeyondBirthdays(HashMap<AccountId, BlockHeight>),
164}
165
166impl<AccountId: Hash + Eq + Debug, E: Debug> Debug for RewindError<AccountId, E> {
167    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
168        match self {
169            RewindError::DataSource(e) => f.debug_tuple("DataSource").field(e).finish(),
170            RewindError::RewindBeyondBirthdays(birthdays) => f
171                .debug_tuple("RewindBeyondBirthdays")
172                .field(birthdays)
173                .finish(),
174        }
175    }
176}
177
178impl<AccountId: Hash + Eq + Debug, E: Display> Display for RewindError<AccountId, E> {
179    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
180        match self {
181            RewindError::DataSource(e) => write!(f, "Wallet data source error: {e}"),
182            RewindError::RewindBeyondBirthdays(birthdays) => write!(
183                f,
184                "Rewind would precede the birthday height of one or more accounts: {birthdays:?}"
185            ),
186        }
187    }
188}
189
190impl<AccountId: Hash + Eq + Debug, E: error::Error + 'static> error::Error
191    for RewindError<AccountId, E>
192{
193    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
194        match self {
195            RewindError::DataSource(e) => Some(e),
196            RewindError::RewindBeyondBirthdays(_) => None,
197        }
198    }
199}
200
201/// Errors that can occur while working with PCZTs.
202#[cfg(feature = "pczt")]
203#[derive(Debug)]
204#[non_exhaustive]
205pub enum PcztError {
206    /// An error occurred while building a PCZT.
207    Build,
208
209    /// An error occurred while finalizing the IO of a PCZT.
210    IoFinalization(pczt::roles::io_finalizer::Error),
211
212    /// An error occurred while updating the Orchard bundle of a PCZT.
213    UpdateOrchard(pczt::roles::updater::OrchardError),
214
215    /// An error occurred while updating the Sapling bundle of a PCZT.
216    UpdateSapling(pczt::roles::updater::SaplingError),
217
218    /// An error occurred while updating the transparent bundle of a PCZT.
219    UpdateTransparent(pczt::roles::updater::TransparentError),
220
221    /// An error occurred while finalizing the spends of a PCZT.
222    SpendFinalization(pczt::roles::spend_finalizer::Error),
223
224    /// An error occurred while extracting a transaction from a PCZT.
225    Extraction(pczt::roles::tx_extractor::Error),
226
227    /// PCZT parsing resulted in an invalid condition.
228    Invalid(String),
229}
230
231/// The ways in which a ZIP 316 Revision 2 recipient address's expiry metadata can
232/// prevent a payment from being constructed.
233#[derive(Debug, Clone, Copy, PartialEq, Eq)]
234#[non_exhaustive]
235pub enum AddressExpiryError {
236    /// The address's expiry time is earlier than the current time.
237    TimeExpired {
238        /// The address's expiry time, in seconds since the Unix epoch.
239        expiry_time: u64,
240    },
241    /// The chain has advanced past the address's expiry height.
242    HeightExpired {
243        /// The address's expiry height.
244        address_expiry: BlockHeight,
245        /// The height of the chain tip against which expiry was evaluated.
246        chain_height: BlockHeight,
247    },
248    /// The transaction's expiry height would exceed the address's expiry height.
249    ///
250    /// ZIP 316 forbids sending in this case rather than lowering the transaction's
251    /// expiry height to match, since an expiry height derived from the address's
252    /// metadata would leak information about the destination on chain.
253    ExpiryHeightConflict {
254        address_expiry: BlockHeight,
255        transaction_expiry: BlockHeight,
256    },
257    /// The address defines an expiry height, which requires the transaction to carry a
258    /// nonzero expiry height, but transaction expiry was disabled.
259    TransactionExpiryDisabled { address_expiry: BlockHeight },
260}
261
262impl fmt::Display for AddressExpiryError {
263    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
264        match self {
265            AddressExpiryError::TimeExpired { expiry_time } => write!(
266                f,
267                "the address expired at {expiry_time} (seconds since the Unix epoch)"
268            ),
269            AddressExpiryError::HeightExpired {
270                address_expiry,
271                chain_height,
272            } => write!(
273                f,
274                "the address expired at height {address_expiry}, and the chain has \
275                 reached height {chain_height}"
276            ),
277            AddressExpiryError::ExpiryHeightConflict {
278                address_expiry,
279                transaction_expiry,
280            } => write!(
281                f,
282                "the transaction would expire at height {transaction_expiry}, after the \
283                 address's expiry height {address_expiry}"
284            ),
285            AddressExpiryError::TransactionExpiryDisabled { address_expiry } => write!(
286                f,
287                "the address expires at height {address_expiry}, which requires the \
288                 transaction to carry a nonzero expiry height, but transaction expiry \
289                 was disabled"
290            ),
291        }
292    }
293}
294
295impl error::Error for AddressExpiryError {}
296
297impl<DE, TE, SE, FE, CE, N> fmt::Display for Error<DE, TE, SE, FE, CE, N>
298where
299    DE: fmt::Display,
300    TE: fmt::Display,
301    SE: fmt::Display,
302    FE: fmt::Display,
303    CE: fmt::Display,
304    N: fmt::Display,
305{
306    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
307        match self {
308            Error::DataSource(e) => {
309                write!(
310                    f,
311                    "The underlying datasource produced the following error: {e}"
312                )
313            }
314            Error::CommitmentTree(e) => {
315                write!(
316                    f,
317                    "An error occurred in querying or updating a note commitment tree: {e}"
318                )
319            }
320            Error::NoteSelection(e) => {
321                write!(f, "Note selection encountered the following error: {e}")
322            }
323            Error::Change(e) => {
324                write!(f, "Change output generation failed: {e}")
325            }
326            Error::Proposal(e) => {
327                write!(
328                    f,
329                    "Input selection attempted to construct an invalid proposal: {e}"
330                )
331            }
332            Error::ProposalNotSupported => write!(
333                f,
334                "The proposal was valid but tried to do something that is not supported \
335                 (spend shielded outputs of prior transaction steps or use a feature that \
336                 is not enabled).",
337            ),
338            Error::KeyNotRecognized => {
339                write!(
340                    f,
341                    "Wallet does not contain an account corresponding to the provided spending key"
342                )
343            }
344            Error::AccountCannotSpend => {
345                write!(
346                    f,
347                    "The given account cannot be used for spending, because it is unable to maintain an accurate balance.",
348                )
349            }
350            Error::AccountIdNotRecognized => {
351                write!(
352                    f,
353                    "Wallet does not contain an account corresponding to the provided ID"
354                )
355            }
356            Error::BalanceError(e) => write!(
357                f,
358                "The value lies outside the valid range of Zcash amounts: {e:?}."
359            ),
360            Error::InsufficientFunds {
361                available,
362                required,
363            } => write!(
364                f,
365                "Insufficient balance (have {}, need {} including fee)",
366                u64::from(*available),
367                u64::from(*required)
368            ),
369            Error::ScanRequired => write!(f, "Must scan blocks first"),
370            Error::Builder(e) => write!(f, "An error occurred building the transaction: {e}"),
371            Error::Payment(e) => write!(f, "An error occurred constructing a payment: {e}"),
372            Error::UnsupportedChangeType(t) => write!(
373                f,
374                "Attempted to send change to an unsupported pool type: {t}"
375            ),
376            Error::NoSupportedReceivers(ua) => write!(
377                f,
378                "A recipient's unified address does not contain any receivers to which the wallet can send funds; required one of {}",
379                ua.receiver_types()
380                    .iter()
381                    .enumerate()
382                    .fold(String::new(), |mut acc, (i, tc)| {
383                        let _ = write!(acc, "{}{:?}", if i > 0 { ", " } else { "" }, tc);
384                        acc
385                    })
386            ),
387            Error::KeyNotAvailable(pool) => write!(
388                f,
389                "A key required for transaction construction was not available for pool type {pool}"
390            ),
391            Error::NoteMismatch(n) => write!(
392                f,
393                "A note being spent ({n:?}) does not correspond to either the internal or external full viewing key for the provided spending key."
394            ),
395
396            Error::Address(e) => {
397                write!(
398                    f,
399                    "An error occurred decoding the address from a payment request: {e}."
400                )
401            }
402            #[cfg(feature = "transparent-inputs")]
403            Error::AddressNotRecognized(_) => {
404                write!(
405                    f,
406                    "The specified transparent address was not recognized as belonging to the wallet."
407                )
408            }
409            Error::ExpiryHeightConflictsWithCanonicalCrossing { requested } => write!(
410                f,
411                "An expiry height of {requested} was requested for a canonical ZIP 318 crossing, \
412                 which takes the ZIP 318 rolling expiry; pass `None` to accept it."
413            ),
414            Error::RecipientAddressExpiry {
415                payment_index,
416                error,
417            } => write!(
418                f,
419                "The recipient address of the payment at index {payment_index} cannot be \
420                 paid: {error}. Try to obtain a currently-valid address for the intended \
421                 recipient."
422            ),
423            Error::ExpiryHeightBelowTargetHeight {
424                expiry_height,
425                min_target_height,
426            } => write!(
427                f,
428                "The requested expiry height {expiry_height} is below the proposal's \
429                 minimum target height {min_target_height}; the transaction would already be \
430                 expired at the earliest height at which it could be mined."
431            ),
432            #[cfg(feature = "pczt")]
433            Error::Pczt(e) => write!(f, "PCZT error: {e}"),
434        }
435    }
436}
437
438#[cfg(feature = "pczt")]
439impl fmt::Display for PcztError {
440    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
441        match self {
442            PcztError::Build => {
443                write!(
444                    f,
445                    "Failed to generate the PCZT prior to proving or signing."
446                )
447            }
448            PcztError::IoFinalization(e) => {
449                write!(f, "Failed to finalize IO: {e:?}.")
450            }
451            PcztError::UpdateOrchard(e) => {
452                write!(f, "Failed to updating Orchard PCZT data: {e:?}.")
453            }
454            PcztError::UpdateSapling(e) => {
455                write!(f, "Failed to updating Sapling PCZT data: {e:?}.")
456            }
457            PcztError::UpdateTransparent(e) => {
458                write!(f, "Failed to updating transparent PCZT data: {e:?}.")
459            }
460            PcztError::SpendFinalization(e) => {
461                write!(f, "Failed to finalize the PCZT spends: {e:?}.")
462            }
463            PcztError::Extraction(e) => {
464                write!(f, "Failed to extract the final transaction: {e:?}.")
465            }
466            PcztError::Invalid(e) => {
467                write!(f, "PCZT parsing resulted in an invalid condition: {e}.")
468            }
469        }
470    }
471}
472
473impl<DE, TE, SE, FE, CE, N> error::Error for Error<DE, TE, SE, FE, CE, N>
474where
475    DE: Debug + Display + error::Error + 'static,
476    TE: Debug + Display + error::Error + 'static,
477    SE: Debug + Display + error::Error + 'static,
478    FE: Debug + Display + 'static,
479    CE: Debug + Display + error::Error + 'static,
480    N: Debug + Display + 'static,
481{
482    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
483        match &self {
484            Error::DataSource(e) => Some(e),
485            Error::CommitmentTree(e) => Some(e),
486            Error::NoteSelection(e) => Some(e),
487            Error::Proposal(e) => Some(e),
488            Error::Builder(e) => Some(e),
489            #[cfg(feature = "pczt")]
490            Error::Pczt(e) => Some(e),
491            _ => None,
492        }
493    }
494}
495
496#[cfg(feature = "pczt")]
497impl error::Error for PcztError {}
498
499impl<DE, TE, SE, FE, CE, N> From<builder::Error<FE>> for Error<DE, TE, SE, FE, CE, N> {
500    fn from(e: builder::Error<FE>) -> Self {
501        Error::Builder(e)
502    }
503}
504
505impl<DE, TE, SE, FE, CE, N> From<ProposalError> for Error<DE, TE, SE, FE, CE, N> {
506    fn from(e: ProposalError) -> Self {
507        Error::Proposal(e)
508    }
509}
510
511impl<DE, TE, SE, FE, CE, N> From<BalanceError> for Error<DE, TE, SE, FE, CE, N> {
512    fn from(e: BalanceError) -> Self {
513        Error::BalanceError(e)
514    }
515}
516
517impl<DE, TE, SE, FE, CE, N> From<ConversionError<&'static str>> for Error<DE, TE, SE, FE, CE, N> {
518    fn from(value: ConversionError<&'static str>) -> Self {
519        Error::Address(value)
520    }
521}
522
523impl<DE, TE, SE, FE, CE, N> From<InputSelectorError<DE, SE, CE, N>>
524    for Error<DE, TE, SE, FE, CE, N>
525{
526    fn from(e: InputSelectorError<DE, SE, CE, N>) -> Self {
527        match e {
528            InputSelectorError::DataSource(e) => Error::DataSource(e),
529            InputSelectorError::Selection(e) => Error::NoteSelection(e),
530            InputSelectorError::Change(e) => Error::Change(e),
531            InputSelectorError::Proposal(e) => Error::Proposal(e),
532            InputSelectorError::InsufficientFunds {
533                available,
534                required,
535            } => Error::InsufficientFunds {
536                available,
537                required,
538            },
539            InputSelectorError::SyncRequired => Error::ScanRequired,
540            InputSelectorError::Address(e) => Error::Address(e),
541        }
542    }
543}
544
545impl<DE, TE, SE, FE, CE, N> From<sapling::builder::Error> for Error<DE, TE, SE, FE, CE, N> {
546    fn from(e: sapling::builder::Error) -> Self {
547        Error::Builder(builder::Error::SaplingBuild(e))
548    }
549}
550
551impl<DE, TE, SE, FE, CE, N> From<transparent::builder::Error> for Error<DE, TE, SE, FE, CE, N> {
552    fn from(e: ::transparent::builder::Error) -> Self {
553        Error::Builder(builder::Error::TransparentBuild(e))
554    }
555}
556
557impl<DE, TE, SE, FE, CE, N> From<ShardTreeError<TE>> for Error<DE, TE, SE, FE, CE, N> {
558    fn from(e: ShardTreeError<TE>) -> Self {
559        Error::CommitmentTree(e)
560    }
561}
562
563#[cfg(feature = "pczt")]
564impl<DE, TE, SE, FE, CE, N> From<PcztError> for Error<DE, TE, SE, FE, CE, N> {
565    fn from(e: PcztError) -> Self {
566        Error::Pczt(e)
567    }
568}
569
570#[cfg(feature = "pczt")]
571impl<DE, TE, SE, FE, CE, N> From<pczt::roles::io_finalizer::Error>
572    for Error<DE, TE, SE, FE, CE, N>
573{
574    fn from(e: pczt::roles::io_finalizer::Error) -> Self {
575        Error::Pczt(PcztError::IoFinalization(e))
576    }
577}
578
579#[cfg(feature = "pczt")]
580impl<DE, TE, SE, FE, CE, N> From<pczt::roles::updater::OrchardError>
581    for Error<DE, TE, SE, FE, CE, N>
582{
583    fn from(e: pczt::roles::updater::OrchardError) -> Self {
584        Error::Pczt(PcztError::UpdateOrchard(e))
585    }
586}
587
588#[cfg(feature = "pczt")]
589impl<DE, TE, SE, FE, CE, N> From<pczt::roles::updater::SaplingError>
590    for Error<DE, TE, SE, FE, CE, N>
591{
592    fn from(e: pczt::roles::updater::SaplingError) -> Self {
593        Error::Pczt(PcztError::UpdateSapling(e))
594    }
595}
596
597#[cfg(feature = "pczt")]
598impl<DE, TE, SE, FE, CE, N> From<pczt::roles::updater::TransparentError>
599    for Error<DE, TE, SE, FE, CE, N>
600{
601    fn from(e: pczt::roles::updater::TransparentError) -> Self {
602        Error::Pczt(PcztError::UpdateTransparent(e))
603    }
604}
605
606#[cfg(feature = "pczt")]
607impl<DE, TE, SE, FE, CE, N> From<pczt::roles::spend_finalizer::Error>
608    for Error<DE, TE, SE, FE, CE, N>
609{
610    fn from(e: pczt::roles::spend_finalizer::Error) -> Self {
611        Error::Pczt(PcztError::SpendFinalization(e))
612    }
613}
614
615#[cfg(feature = "pczt")]
616impl<DE, TE, SE, FE, CE, N> From<pczt::roles::tx_extractor::Error>
617    for Error<DE, TE, SE, FE, CE, N>
618{
619    fn from(e: pczt::roles::tx_extractor::Error) -> Self {
620        Error::Pczt(PcztError::Extraction(e))
621    }
622}
623
624/// Errors that may occur when resolving the account controlling an address.
625#[derive(Debug)]
626#[non_exhaustive]
627pub enum FindAccountForAddressError<E> {
628    /// Error returned by the underlying wallet backend.
629    Backend(E),
630
631    /// A Unified Address whose receivers map to different accounts.
632    UnifiedAddressConflict,
633}
634
635impl<E> From<E> for FindAccountForAddressError<E> {
636    fn from(err: E) -> Self {
637        Self::Backend(err)
638    }
639}
640
641impl<E: Display> Display for FindAccountForAddressError<E> {
642    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
643        match self {
644            FindAccountForAddressError::Backend(e) => {
645                write!(f, "Wallet backend error: {e}")
646            }
647            FindAccountForAddressError::UnifiedAddressConflict => write!(
648                f,
649                "Receivers of the provided Unified Address map to different wallet accounts."
650            ),
651        }
652    }
653}
654
655impl<E: error::Error + 'static> error::Error for FindAccountForAddressError<E> {
656    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
657        match self {
658            FindAccountForAddressError::Backend(e) => Some(e),
659            FindAccountForAddressError::UnifiedAddressConflict => None,
660        }
661    }
662}
663
664pub use super::locking::LockError;