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: U256,
s: U256,
) -> Self
pub fn new_unchecked( inner: Authorization, y_parity: u8, r: U256, s: U256, ) -> Self
Creates a new signed authorization from raw signature values.
Sourcepub fn signature(&self) -> Result<PrimitiveSignature, SignatureError>
pub fn signature(&self) -> Result<PrimitiveSignature, 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
Recover the authority for the authorization.
§Note
Implementers should check that the authority has no code.
Sourcepub fn into_recovered(self) -> RecoveredAuthorization
pub fn into_recovered(self) -> RecoveredAuthorization
Recover the authority and transform the signed authorization into a
RecoveredAuthorization
.
Methods from Deref<Target = Authorization>§
Sourcepub fn chain_id(&self) -> u64
pub fn chain_id(&self) -> u64
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) -> B256
pub fn signature_hash(&self) -> B256
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
impl<'a> Arbitrary<'a> for SignedAuthorization
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
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§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§impl<'de> Deserialize<'de> for SignedAuthorization
impl<'de> Deserialize<'de> for SignedAuthorization
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<SignedAuthorization, D::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) -> Self
fn from(value: &'a SignedAuthorization) -> Self
Source§impl<'a> From<SignedAuthorization<'a>> for SignedAuthorization
impl<'a> From<SignedAuthorization<'a>> for SignedAuthorization
Source§fn from(value: SignedAuthorization<'a>) -> Self
fn from(value: SignedAuthorization<'a>) -> Self
Source§impl From<SignedAuthorization> for RecoveredAuthority
impl From<SignedAuthorization> for RecoveredAuthority
Source§fn from(value: SignedAuthorization) -> Self
fn from(value: SignedAuthorization) -> Self
Source§impl From<SignedAuthorization> for RecoveredAuthorization
impl From<SignedAuthorization> for RecoveredAuthorization
Source§fn from(value: SignedAuthorization) -> Self
fn from(value: SignedAuthorization) -> Self
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§impl SerializeAs<SignedAuthorization> for SignedAuthorization<'_>
impl SerializeAs<SignedAuthorization> for SignedAuthorization<'_>
Source§fn serialize_as<S>(
source: &SignedAuthorization,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &SignedAuthorization,
serializer: S,
) -> Result<S::Ok, S::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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)