alloy_network

Trait TxSignerSync

Source
pub trait TxSignerSync<Signature> {
    // Required methods
    fn address(&self) -> Address;
    fn sign_transaction_sync(
        &self,
        tx: &mut dyn SignableTransaction<Signature>,
    ) -> Result<Signature>;
}
Expand description

Synchronous transaction signer, capable of signing any SignableTransaction for the given Signature type.

A signer should hold an optional ChainId value, which is used for EIP-155 replay protection.

If chain_id is Some, EIP-155 should be applied to the input transaction in sign_transaction_sync, and to the resulting signature in all the methods. If chain_id is None, EIP-155 should not be applied.

Synchronous signers should also implement TxSigner, as they are always able to by delegating the asynchronous methods to the synchronous ones.

Required Methods§

Source

fn address(&self) -> Address

Get the address of the signer.

Source

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Synchronously sign an unsigned transaction.

Implementations on Foreign Types§

Source§

impl<'a, Signature, T: 'a + TxSignerSync<Signature> + ?Sized> TxSignerSync<Signature> for &'a T

Source§

fn address(&self) -> Address

Source§

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Source§

impl<'a, Signature, T: 'a + TxSignerSync<Signature> + ?Sized> TxSignerSync<Signature> for &'a mut T

Source§

fn address(&self) -> Address

Source§

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Source§

impl<Signature, T: TxSignerSync<Signature> + ?Sized> TxSignerSync<Signature> for Box<T>

Source§

fn address(&self) -> Address

Source§

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Source§

impl<Signature, T: TxSignerSync<Signature> + ?Sized> TxSignerSync<Signature> for Rc<T>

Source§

fn address(&self) -> Address

Source§

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Source§

impl<Signature, T: TxSignerSync<Signature> + ?Sized> TxSignerSync<Signature> for Arc<T>

Source§

fn address(&self) -> Address

Source§

fn sign_transaction_sync( &self, tx: &mut dyn SignableTransaction<Signature>, ) -> Result<Signature>

Implementors§