Trait SignerRecoverable

pub trait SignerRecoverable {
    // Required methods
    fn recover_signer(&self) -> Result<Address, RecoveryError>;
    fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>;

    // Provided methods
    fn try_into_recovered(self) -> Result<Recovered<Self>, RecoveryError>
       where Self: Sized { ... }
    fn try_into_recovered_unchecked(
        self,
    ) -> Result<Recovered<Self>, RecoveryError>
       where Self: Sized { ... }
    fn try_to_recovered_ref(&self) -> Result<Recovered<&Self>, RecoveryError> { ... }
    fn try_to_recovered_ref_unchecked(
        &self,
    ) -> Result<Recovered<&Self>, RecoveryError> { ... }
}
Expand description

A type that can recover the signer of a transaction.

This is a helper trait that only provides the ability to recover the signer (address) of a transaction.

Required Methods§

fn recover_signer(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash.

Returns an error if the transaction’s signature is invalid following EIP-2.

Note:

This can fail for some early ethereum mainnet transactions pre EIP-2, use Self::recover_signer_unchecked if you want to recover the signer without ensuring that the signature has a low s value.

fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash without ensuring that the signature has a low s value.

Returns an error if the transaction’s signature is invalid.

Provided Methods§

fn try_into_recovered(self) -> Result<Recovered<Self>, RecoveryError>
where Self: Sized,

Recover the signer via SignerRecoverable::recover_signer and returns a Recovered<Self>

fn try_into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>
where Self: Sized,

Recover the signer via SignerRecoverable::recover_signer_unchecked and returns a Recovered<&Self>

fn try_to_recovered_ref(&self) -> Result<Recovered<&Self>, RecoveryError>

Recover the signer via SignerRecoverable::recover_signer and returns a Recovered<&Self>

fn try_to_recovered_ref_unchecked( &self, ) -> Result<Recovered<&Self>, RecoveryError>

Recover the signer via SignerRecoverable::recover_signer_unchecked and returns a Recovered<&Self>

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§

§

impl SignerRecoverable for OpPooledTransaction

§

impl SignerRecoverable for OpTxEnvelope

§

impl SignerRecoverable for SeismicTxEnvelope

Implementors§

Source§

impl<B, T> SignerRecoverable for Extended<B, T>
where B: SignedTransaction + IsTyped2718, T: SignedTransaction,

§

impl<Eip4844> SignerRecoverable for EthereumTxEnvelope<Eip4844>
where Eip4844: RlpEcdsaEncodableTx + SignableTransaction<Signature>,

§

impl<T> SignerRecoverable for WithEncoded<T>