hopr_chain_api::executors

Trait EthereumClient

Source
pub trait EthereumClient<T: Into<TypedTransaction>> {
    // Required methods
    fn post_transaction<'life0, 'async_trait>(
        &'life0 self,
        tx: T,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn post_transaction_and_await_confirmation<'life0, 'async_trait>(
        &'life0 self,
        tx: T,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Represents an abstract client that is capable of submitting an Ethereum transaction-like object to the blockchain.

Required Methods§

Source

fn post_transaction<'life0, 'async_trait>( &'life0 self, tx: T, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends transaction to the blockchain and returns its hash.

Does not poll for transaction completion.

Source

fn post_transaction_and_await_confirmation<'life0, 'async_trait>( &'life0 self, tx: T, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends transaction to the blockchain and awaits the required number of confirmations by polling the underlying provider periodically.

Returns the TX hash.

Implementors§

Source§

impl<Rpc: HoprRpcOperations + Send + Sync> EthereumClient<TypedTransaction> for RpcEthereumClient<Rpc>