op_alloy_network

Trait TxSignerSync

pub trait TxSignerSync<Signature> {
    // Required methods
    fn address(&self) -> Address;
    fn sign_transaction_sync(
        &self,
        tx: &mut (dyn SignableTransaction<Signature> + 'static),
    ) -> Result<Signature, Error>;
}
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§

fn address(&self) -> Address

Get the address of the signer.

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

Synchronously sign an unsigned transaction.

Implementations on Foreign Types§

§

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

§

fn address(&self) -> Address

§

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

§

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

§

fn address(&self) -> Address

§

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

§

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

§

fn address(&self) -> Address

§

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

§

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

§

fn address(&self) -> Address

§

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

§

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

§

fn address(&self) -> Address

§

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

Implementors§