#[non_exhaustive]pub enum AccountError {
Show 19 variants
Locked,
ProfileNotFound(ProfileIx),
DefaultProfileInvariant(String),
ProfileAlreadyRegistered(ProfileIx),
ProfileIdentityAlreadyRegistered {
existing: ProfileIx,
did: String,
},
ActiveProfileCannotBeHidden(ProfileIx),
ProfileEnded(ProfileIx),
ProfileEndHeightZero,
MintAlreadyInProgress(ProfileIx),
MismatchedMintHalves {
did_coin_id: Bytes32,
store_launched_from: Bytes32,
},
MintFeeAboveCeiling {
fee: u64,
ceiling: u64,
},
RegistryInvariant(String),
NoActiveProfile,
Keystore(String),
Auth(String),
Spend(String),
UserDeclined(String),
PolicyDenied(String),
PolicyIndeterminate(String),
}Expand description
Every failure mode surfaced by the dig-account public API.
Fail-closed: any ambiguity in an unlock, signing, or custody path resolves to an error here rather than a silent success.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Locked
The account (or the requested operation) is locked; unlock first.
ProfileNotFound(ProfileIx)
No profile exists at the requested index.
DefaultProfileInvariant(String)
The exactly-one-default invariant was violated.
ProfileAlreadyRegistered(ProfileIx)
A profile is already recorded at this index.
An anchor is evidence of ONE specific on-chain mint, so re-recording an index would replace a proof with a different proof. The existing entry is left untouched.
ProfileIdentityAlreadyRegistered
A profile with this IDENTITY is already recorded, at a different index.
A profile IS its on-chain identity. Two entries claiming one DID would derive different wallet keys and different DEKs from their two indices while presenting as the same person, so the account could receive at an address the identity’s own surfaces never show. The existing entry is left untouched.
Fields
ActiveProfileCannotBeHidden(ProfileIx)
The ACTIVE profile cannot be hidden from the host’s lists.
A hidden active profile is a trap: the UI lists nothing while the wallet keeps deriving and receiving at that index. Switch away first, then hide.
ProfileEnded(ProfileIx)
The profile has ENDED on chain — both of its singletons were melted — so it cannot be made active, and no host may present it as a live profile.
The entry is deliberately KEPT rather than deleted: its DID string remains the right answer to “what did this account used to be”, and an absence cannot say that a profile ended.
ProfileEndHeightZero
A profile end was recorded at height 0, which no on-chain confirmation can produce.
Recording one would let a submission masquerade as a confirmation — the same rule the mint
anchors enforce (SPEC.md §2.4).
MintAlreadyInProgress(ProfileIx)
A mint is already journalled at this index.
Beginning a second one would re-mint a DID that may already be paid for, orphaning the first (dig_ecosystem#2377). Resume the journalled mint instead.
MismatchedMintHalves
The two halves of a mint do not belong to each other: the store was launched from some other DID’s coin.
Each evidence proves only that its OWN coin confirmed, so pairing them is where the relationship is checked. Recording this pair would assert a profile that does not exist. Both ids are public coin ids.
Fields
MintFeeAboveCeiling
A disclosed mint fee is above the mint’s hard ceiling
(MAX_MINT_FEE_MOJOS).
The journalled store fee is the amount a resumed phase B is allowed to spend, so an unbounded one turns a restart into a route for handing a wallet coin to a farmer — exactly what the DID half’s ceiling already refuses. Same ceiling, deliberately: a different limit for the second bundle would be a design decision, not a bound.
RegistryInvariant(String)
A profile registry violated one of its four invariants — usually an edited or corrupt file.
Fail-closed: the registry is not partially loaded, so a host never acts on a half-valid profile list.
NoActiveProfile
The account has no active profile, because it has no confirmed profile at all.
This is the pre-mint state of every new account, not a fault: the host’s answer is to run the first-run mint, never to invent an index.
Keystore(String)
An underlying keystore operation failed.
Auth(String)
Authentication or unlock-policy evaluation rejected the attempt.
Spend(String)
A money-path spend operation failed — spend verification, summary derivation, or signing was refused. Fail-closed: the money signer surfaces every rejection here rather than producing a signature it could not fully account for.
UserDeclined(String)
The USER declined the spend at the confirm ceremony.
Distinct from PolicyDenied because the two are different facts about
different deciders, and a host reports them differently: “you said no” is an ordinary outcome,
while “the rules say no” may mean a misconfiguration. Merging them would also make the normative
wire mapping (SPEC.md §6.3.1) ambiguous — one crate outcome cannot map to two codes — and
collapsing outcomes at a boundary is the defect this crate’s 0.5.0 shape exists to remove.
Terminal: no further ceremony may permit a spend the user has already refused.
PolicyDenied(String)
The spend is FORBIDDEN by a structural custody rule — no confirmation ceremony can permit it.
A user’s refusal is NOT this variant; it is UserDeclined. Both are
terminal, but they name different deciders and SPEC.md §6.3.1 maps them to different wire
codes, so a host must be able to tell them apart.
§The escalatable outcome is deliberately NOT an error
“Not auto-approved, but a human could permit it” is
SpendRuling::RequiresConfirmation
— an Ok value carrying a
PendingApproval — never a variant here. When it
WAS an error variant (RequireAuth, removed in 0.5.0), the crate’s only consumer collapsed
every Err into one refusal and the confirm ceremony became unreachable for exactly the tiers
that exist to require it. Every variant in this enum is now terminal for the spend, so
collapsing them can lose detail but can no longer lose a permission.
The canonical structural case is a vault outflow to anything other than the profile’s own hot wallet (#1504: every vault outflow MUST pass through the 24h clawback window, so it may only ever pay the hot wallet).
PolicyIndeterminate(String)
The policy COULD NOT BE EVALUATED for this spend — the answer is unknown, not “no”.
Kept separate from PolicyDenied because collapsing “denied by policy”
with “could not determine policy” into one refusal loses the only signal that the gate is
malfunctioning (an unreadable clock, an undecodable recipient address, a spend whose value is
denominated in units no configured limit can bound, a rolling window zero seconds long). Every
indeterminate outcome refuses the spend, and none of them is escalatable — the condition must be
fixed, not confirmed away.
Trait Implementations§
Source§impl Debug for AccountError
impl Debug for AccountError
Source§impl Display for AccountError
impl Display for AccountError
Source§impl Error for AccountError
impl Error for AccountError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AccountError
impl RefUnwindSafe for AccountError
impl Send for AccountError
impl Sync for AccountError
impl Unpin for AccountError
impl UnsafeUnpin for AccountError
impl UnwindSafe for AccountError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.