pub enum MandateError {
Show 17 variants
InvalidIntent,
InvalidCart,
InvalidPayment,
UntrustedSigner(&'static str),
ConversationMismatch(&'static str),
CallerMismatch,
Expired {
kind: &'static str,
expires_at_unix: u64,
},
CartNotChainedToIntent,
PaymentNotChainedToCart,
MalformedAmount(&'static str),
AmountWidensAtCart {
cart: u128,
intent: u128,
},
AmountWidensAtPayment {
payment: u128,
cart: u128,
},
CurrencyMismatch,
EmptyScope,
ExceedsAuthorization {
authorized: u128,
authorized_host: String,
requested: u128,
requested_host: String,
},
ArgsBindingMismatch,
ApprovalDoesNotAuthorizeCall,
}Expand description
Raised while validating a MandateChain or authorizing a spend
against a VerifiedMandateChain.
Variants§
InvalidIntent
The Intent mandate is malformed or its signature does not verify.
InvalidCart
The Cart mandate is malformed or its signature does not verify.
InvalidPayment
The Payment mandate is malformed or its signature does not verify.
UntrustedSigner(&'static str)
A link’s signer is neither the platform issuer key nor (for the Intent link, when a persona credential is on record) the persona’s own recorded signing key.
ConversationMismatch(&'static str)
A link is bound to a different conversation than the one it is being consumed in.
CallerMismatch
The chain’s links are not all bound to one consistent caller.
Expired
A link has expired as of the check time.
CartNotChainedToIntent
The Cart’s intent_hash does not reference the presented Intent.
PaymentNotChainedToCart
The Payment’s cart_hash does not reference the presented Cart.
MalformedAmount(&'static str)
A signed amount field is not a parseable base-unit integer. Fails closed: a mandate whose amount cannot be understood authorizes nothing.
AmountWidensAtCart
The Cart’s amount exceeds the Intent’s ceiling (widening).
AmountWidensAtPayment
The Payment’s amount exceeds the Cart’s amount (widening).
CurrencyMismatch
Currency differs across the chain.
EmptyScope
The Cart’s merchant scope is empty — a scopeless cart authorizes nothing (fail closed).
ExceedsAuthorization
A verified chain does not cover the proposed spend (amount or destination).
Fields
The base-unit amount the chain authorizes.
The merchant host the chain authorizes spend against.
ArgsBindingMismatch
The call’s args do not match the exact args_json the Payment
mandate signed — a mandate minted for one call cannot authorize a
different one.
ApprovalDoesNotAuthorizeCall
The verified HITL approval offered as the trust root does not authorize the exact call the Payment mandate is being minted for.
Trait Implementations§
Source§impl Clone for MandateError
impl Clone for MandateError
Source§fn clone(&self) -> MandateError
fn clone(&self) -> MandateError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MandateError
impl Debug for MandateError
Source§impl Display for MandateError
impl Display for MandateError
impl Eq for MandateError
Source§impl Error for MandateError
impl Error for MandateError
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()
Source§impl PartialEq for MandateError
impl PartialEq for MandateError
impl StructuralPartialEq for MandateError
Auto Trait Implementations§
impl Freeze for MandateError
impl RefUnwindSafe for MandateError
impl Send for MandateError
impl Sync for MandateError
impl Unpin for MandateError
impl UnsafeUnpin for MandateError
impl UnwindSafe for MandateError
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more