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<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
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<'a> SerializeAs<SignedAuthorization> for SignedAuthorization<'a>
impl<'a> SerializeAs<SignedAuthorization> for SignedAuthorization<'a>
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
)