pub struct SignedCapability {
pub capability: Capability,
pub signature: Signature,
}Expand description
A capability together with its EIP-712 owner signature.
Fields§
§capability: CapabilityThe delegation itself.
signature: SignatureThe pool owner’s EIP-712 signature over it.
Implementations§
Source§impl SignedCapability
impl SignedCapability
Sourcepub fn recover_owner(
&self,
domain: &Eip712Domain,
) -> Result<Address, CapabilityError>
pub fn recover_owner( &self, domain: &Eip712Domain, ) -> Result<Address, CapabilityError>
Recover the owner address that signed this capability under domain.
§Errors
Returns CapabilityError::InvalidSignature if the signature is
malformed (non-canonical high-s, invalid recovery id, etc.) —
rejecting high-s up front so the off-chain accept-set matches the
on-chain verifiable-set (#836), exactly as voucher recovery does.
Sourcepub fn verify_owner(
&self,
expected: Address,
domain: &Eip712Domain,
) -> Result<(), CapabilityError>
pub fn verify_owner( &self, expected: Address, domain: &Eip712Domain, ) -> Result<(), CapabilityError>
Verify the capability was signed by expected (the pool owner) for
domain.
§Errors
CapabilityError::InvalidSignature— signature is malformed.CapabilityError::WrongOwner— recovered address differs fromexpected.
Trait Implementations§
Source§impl Clone for SignedCapability
impl Clone for SignedCapability
Source§impl Debug for SignedCapability
impl Debug for SignedCapability
impl Eq for SignedCapability
Source§impl PartialEq for SignedCapability
impl PartialEq for SignedCapability
impl StructuralPartialEq for SignedCapability
Auto Trait Implementations§
impl Freeze for SignedCapability
impl RefUnwindSafe for SignedCapability
impl Send for SignedCapability
impl Sync for SignedCapability
impl Unpin for SignedCapability
impl UnsafeUnpin for SignedCapability
impl UnwindSafe for SignedCapability
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
Mutably borrows from an owned value. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
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> ⓘ
Converts
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> ⓘ
Converts
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