revm_transaction::eip7702

Trait Authorization

Source
pub trait Authorization {
    // Required methods
    fn authority(&self) -> Option<Address>;
    fn chain_id(&self) -> U256;
    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) -> U256

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.

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) -> U256

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

Source§

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

Source§

fn chain_id(&self) -> U256

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>

Source§

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

Source§

fn chain_id(&self) -> U256

Source§

fn nonce(&self) -> u64

Source§

fn address(&self) -> Address

Source§

fn is_invalid(&self) -> bool

Implementors§