Trait alloy_provider::fillers::TxFiller

source ·
pub trait TxFiller<N: Network = Ethereum>: Clone + Send + Sync + Debug {
    type Fillable: Send + Sync + 'static;

    // Required methods
    fn status(&self, tx: &N::TransactionRequest) -> FillerControlFlow;
    fn fill_sync(&self, tx: &mut SendableTx<N>);
    fn prepare<P, T>(
        &self,
        provider: &P,
        tx: &N::TransactionRequest,
    ) -> impl Send + Future<Output = TransportResult<Self::Fillable>>
       where P: Provider<T, N>,
             T: Transport + Clone;
    fn fill(
        &self,
        fillable: Self::Fillable,
        tx: SendableTx<N>,
    ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>;

    // Provided methods
    fn join_with<T>(self, other: T) -> JoinFill<Self, T>
       where T: TxFiller<N> { ... }
    fn continue_filling(&self, tx: &SendableTx<N>) -> bool { ... }
    fn ready(&self, tx: &N::TransactionRequest) -> bool { ... }
    fn finished(&self, tx: &N::TransactionRequest) -> bool { ... }
    fn prepare_and_fill<P, T>(
        &self,
        provider: &P,
        tx: SendableTx<N>,
    ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>
       where P: Provider<T, N>,
             T: Transport + Clone { ... }
}
Expand description

A layer that can fill in a TransactionRequest with additional information.

§Lifecycle Notes

The FillerControlFlow determines the lifecycle of a filler. Fillers may be in one of three states:

Required Associated Types§

source

type Fillable: Send + Sync + 'static

The properties that this filler retrieves from the RPC. to fill in the TransactionRequest.

Required Methods§

source

fn status(&self, tx: &N::TransactionRequest) -> FillerControlFlow

Return a control-flow enum indicating whether the filler is ready to fill in the transaction request, or if it is missing required properties.

source

fn fill_sync(&self, tx: &mut SendableTx<N>)

Performs any synchronous filling. This should be called before TxFiller::prepare and TxFiller::fill to fill in any properties that can be filled synchronously.

source

fn prepare<P, T>( &self, provider: &P, tx: &N::TransactionRequest, ) -> impl Send + Future<Output = TransportResult<Self::Fillable>>
where P: Provider<T, N>, T: Transport + Clone,

Prepares fillable properties, potentially by making an RPC request.

source

fn fill( &self, fillable: Self::Fillable, tx: SendableTx<N>, ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>

Fills in the transaction request with the fillable properties.

Provided Methods§

source

fn join_with<T>(self, other: T) -> JoinFill<Self, T>
where T: TxFiller<N>,

Joins this filler with another filler to compose multiple fillers.

source

fn continue_filling(&self, tx: &SendableTx<N>) -> bool

Returns true if the filler is should continue filling.

source

fn ready(&self, tx: &N::TransactionRequest) -> bool

Returns true if the filler is ready to fill in the transaction request.

source

fn finished(&self, tx: &N::TransactionRequest) -> bool

Returns true if the filler is finished filling in the transaction request.

source

fn prepare_and_fill<P, T>( &self, provider: &P, tx: SendableTx<N>, ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>
where P: Provider<T, N>, T: Transport + Clone,

Prepares and fills the transaction request with the fillable properties.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<L, R, N> TxFiller<N> for JoinFill<L, R>
where L: TxFiller<N>, R: TxFiller<N>, N: Network,

§

type Fillable = (Option<<L as TxFiller<N>>::Fillable>, Option<<R as TxFiller<N>>::Fillable>)

source§

impl<M: NonceManager, N: Network> TxFiller<N> for NonceFiller<M>

source§

impl<N> TxFiller<N> for Identity
where N: Network,

§

type Fillable = ()

source§

impl<N: Network> TxFiller<N> for BlobGasFiller

source§

impl<N: Network> TxFiller<N> for ChainIdFiller

source§

impl<N: Network> TxFiller<N> for GasFiller

§

type Fillable = GasFillable

source§

impl<W, N> TxFiller<N> for WalletFiller<W>
where N: Network, W: NetworkWallet<N> + Clone,

§

type Fillable = ()