Trait SignerRecoverable

Source
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§

Source

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.

Source

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§

Source

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

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

Source

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>

Source

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

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

Source

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§

Source§

impl<T> SignerRecoverable for WithEncoded<T>

Implementors§