revm_context_interface::transaction::eip7702

Trait Authorization

Source
pub trait Authorization: Clone {
    // Required methods
    fn authority(&self) -> Option<Address>;
    fn chain_id(&self) -> u64;
    fn nonce(&self) -> u64;
    fn address(&self) -> Address;
    fn is_invalid(&self) -> bool;
}
Expand description

Authorization trait.

Required Methods§

Source

fn authority(&self) -> Option<Address>

Authority address.

§Note

Authority signature can be invalid, so this method returns None if the authority could not be recovered.

Valid signature Parity should be 0 or 1 and signature s-value should be less than SECP256K1N_HALF.

Source

fn chain_id(&self) -> u64

Returns authorization the chain id.

Source

fn nonce(&self) -> u64

Returns the nonce.

§Note

If nonce is not same as the nonce of the signer account, the authorization is skipped.

Source

fn address(&self) -> Address

Returns the address that this account is delegated to.

Source

fn is_invalid(&self) -> bool

Returns true if the authorization is valid.

Temporary method needed for older EIP spec and will removed in future when test get updated.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Authorization for RecoveredAuthorization

Source§

fn authority(&self) -> Option<Address>

Authority address. Obtained by recovering of the signature.

Source§

fn chain_id(&self) -> u64

Returns authorization the chain id.

Source§

fn nonce(&self) -> u64

Returns the nonce.

§Note

If nonce is not same as the nonce of the signer account, authorization is skipped and considered invalidated.

Source§

fn address(&self) -> Address

Returns the address that this account should delegate to.

Source§

fn is_invalid(&self) -> bool

Returns true if the authorization is valid.

Temporary method needed for older EIP spec and will removed in future

Source§

impl<'a, T: 'a + Authorization + ?Sized> Authorization for &'a T
where &'a T: Clone,

Source§

fn authority(&self) -> Option<Address>

Source§

fn chain_id(&self) -> u64

Source§

fn nonce(&self) -> u64

Source§

fn address(&self) -> Address

Source§

fn is_invalid(&self) -> bool

Source§

impl<T: Authorization + ?Sized> Authorization for Arc<T>
where Arc<T>: Clone,

Source§

fn authority(&self) -> Option<Address>

Source§

fn chain_id(&self) -> u64

Source§

fn nonce(&self) -> u64

Source§

fn address(&self) -> Address

Source§

fn is_invalid(&self) -> bool

Implementors§