pub enum SignerAuthorization {
Unregistered,
Registered {
cap: u64,
expiry: u64,
spent: u64,
},
}Expand description
A voucher signer’s on-chain authorization in one pool, as a node’s admit path
and a capability client read it from getAuthorization (ADR 003 §Capability delegation).
Variants§
Unregistered
The signer holds no registration (the all-zero Authorization). Its first
redemption registers whichever owner-signed capability lands first.
Registered
The signer is registered. cap and expiry are write-once on-chain, so
they never change for this (pool, signer); spent only grows.
Implementations§
Source§impl SignerAuthorization
impl SignerAuthorization
Sourcepub const fn from_onchain(auth: &Authorization) -> Self
pub const fn from_onchain(auth: &Authorization) -> Self
Classify a raw getAuthorization result. The contract marks a signer
registered when cap != 0 || expiry != 0, so a registration with a zero
cap but a non-zero expiry is registered with no headroom.
Sourcepub fn covers(self, floor_micro: U256, now: u64) -> bool
pub fn covers(self, floor_micro: U256, now: u64) -> bool
Whether the signer can still pay at least floor_micro at Unix time now.
An unregistered signer always can: it admits on its presented capability.
A registered signer needs a live registration and cap − spent headroom
of at least floor_micro.
Trait Implementations§
Source§impl Clone for SignerAuthorization
impl Clone for SignerAuthorization
impl Copy for SignerAuthorization
Source§impl Debug for SignerAuthorization
impl Debug for SignerAuthorization
impl Eq for SignerAuthorization
Source§impl PartialEq for SignerAuthorization
impl PartialEq for SignerAuthorization
impl StructuralPartialEq for SignerAuthorization
Auto Trait Implementations§
impl Freeze for SignerAuthorization
impl RefUnwindSafe for SignerAuthorization
impl Send for SignerAuthorization
impl Sync for SignerAuthorization
impl Unpin for SignerAuthorization
impl UnsafeUnpin for SignerAuthorization
impl UnwindSafe for SignerAuthorization
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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