pub struct SignedAuthorization { /* private fields */ }Expand description
A signed EIP-7702 authorization.
Implementations§
Source§impl SignedAuthorization
impl SignedAuthorization
Sourcepub fn new_unchecked(
inner: Authorization,
y_parity: u8,
r: Uint<256, 4>,
s: Uint<256, 4>,
) -> SignedAuthorization
pub fn new_unchecked( inner: Authorization, y_parity: u8, r: Uint<256, 4>, s: Uint<256, 4>, ) -> SignedAuthorization
Creates a new signed authorization from raw signature values.
Sourcepub fn signature(&self) -> Result<Signature, SignatureError>
pub fn signature(&self) -> Result<Signature, SignatureError>
Gets the signature for the authorization. Returns SignatureError if signature could
not be constructed from vrs values.
Note that this signature might still be invalid for recovery as it might have s value
greater than secp256k1n/2.
Sourcepub const fn strip_signature(self) -> Authorization
pub const fn strip_signature(self) -> Authorization
Returns the inner Authorization.
Sourcepub const fn inner(&self) -> &Authorization
pub const fn inner(&self) -> &Authorization
Returns the inner Authorization.
Source§impl SignedAuthorization
impl SignedAuthorization
Available on crate feature k256 only.
k256 only.Recover the authority for the authorization.
§Note
Implementers should check that the authority has no code.
Sourcepub fn into_recovered(self) -> RecoveredAuthorization
Available on crate feature k256 only.
pub fn into_recovered(self) -> RecoveredAuthorization
k256 only.Recover the authority and transform the signed authorization into a
RecoveredAuthorization.
Methods from Deref<Target = Authorization>§
Sourcepub fn chain_id(&self) -> &Uint<256, 4>
pub fn chain_id(&self) -> &Uint<256, 4>
Get the chain_id for the authorization.
§Note
Implementers should check that this matches the current chain_id or is 0.
Sourcepub fn signature_hash(&self) -> FixedBytes<32>
pub fn signature_hash(&self) -> FixedBytes<32>
Computes the signature hash used to sign the authorization, or recover the authority from a signed authorization list item.
The signature hash is keccak(MAGIC || rlp([chain_id, address, nonce]))
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for SignedAuthorization
Available on (crate features arbitrary) and crate feature k256 only.
impl<'a> Arbitrary<'a> for SignedAuthorization
arbitrary) and crate feature k256 only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignedAuthorization, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignedAuthorization, Error>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl BorshDeserialize for SignedAuthorization
impl BorshDeserialize for SignedAuthorization
fn deserialize_reader<__R>(
reader: &mut __R,
) -> Result<SignedAuthorization, Error>where
__R: Read,
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SignedAuthorization
impl BorshSerialize for SignedAuthorization
Source§impl Clone for SignedAuthorization
impl Clone for SignedAuthorization
Source§fn clone(&self) -> SignedAuthorization
fn clone(&self) -> SignedAuthorization
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedAuthorization
impl Debug for SignedAuthorization
Source§impl Decodable for SignedAuthorization
impl Decodable for SignedAuthorization
Source§impl Deref for SignedAuthorization
impl Deref for SignedAuthorization
Source§type Target = Authorization
type Target = Authorization
Source§impl<'de> Deserialize<'de> for SignedAuthorization
Available on crate feature serde only.
impl<'de> Deserialize<'de> for SignedAuthorization
serde only.Source§fn deserialize<D>(
deserializer: D,
) -> Result<SignedAuthorization, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SignedAuthorization, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<'de> DeserializeAs<'de, SignedAuthorization> for SignedAuthorization<'de>
impl<'de> DeserializeAs<'de, SignedAuthorization> for SignedAuthorization<'de>
Source§fn deserialize_as<D>(
deserializer: D,
) -> Result<SignedAuthorization, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<SignedAuthorization, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Encodable for SignedAuthorization
impl Encodable for SignedAuthorization
Source§impl<'a> From<&'a SignedAuthorization> for SignedAuthorization<'a>
impl<'a> From<&'a SignedAuthorization> for SignedAuthorization<'a>
Source§fn from(value: &'a SignedAuthorization) -> SignedAuthorization<'a>
fn from(value: &'a SignedAuthorization) -> SignedAuthorization<'a>
Source§impl<'a> From<SignedAuthorization<'a>> for SignedAuthorization
impl<'a> From<SignedAuthorization<'a>> for SignedAuthorization
Source§fn from(value: SignedAuthorization<'a>) -> SignedAuthorization
fn from(value: SignedAuthorization<'a>) -> SignedAuthorization
Source§impl From<SignedAuthorization> for RecoveredAuthority
Available on crate feature k256 only.
impl From<SignedAuthorization> for RecoveredAuthority
k256 only.Source§fn from(value: SignedAuthorization) -> RecoveredAuthority
fn from(value: SignedAuthorization) -> RecoveredAuthority
Source§impl From<SignedAuthorization> for RecoveredAuthorization
Available on crate feature k256 only.
impl From<SignedAuthorization> for RecoveredAuthorization
k256 only.Source§fn from(value: SignedAuthorization) -> RecoveredAuthorization
fn from(value: SignedAuthorization) -> RecoveredAuthorization
Source§impl Hash for SignedAuthorization
impl Hash for SignedAuthorization
Source§impl PartialEq for SignedAuthorization
impl PartialEq for SignedAuthorization
Source§impl Serialize for SignedAuthorization
impl Serialize for SignedAuthorization
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl SerializeAs<SignedAuthorization> for SignedAuthorization<'_>
impl SerializeAs<SignedAuthorization> for SignedAuthorization<'_>
Source§fn serialize_as<S>(
source: &SignedAuthorization,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &SignedAuthorization,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Eq for SignedAuthorization
impl StructuralPartialEq for SignedAuthorization
Auto Trait Implementations§
impl Freeze for SignedAuthorization
impl RefUnwindSafe for SignedAuthorization
impl Send for SignedAuthorization
impl Sync for SignedAuthorization
impl Unpin for SignedAuthorization
impl UnwindSafe for SignedAuthorization
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
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<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 moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes