Skip to main content

FoundryChain

Trait FoundryChain 

pub trait FoundryChain<Tx>:
    Clone
    + Debug
    + Default
    + Send
    + Sync {
    // Provided methods
    fn for_transaction(_tx: &Tx) -> Self { ... }
    fn for_block(
        _grandparent: &[Tx],
        _parent: &[Tx],
        _current: &[Tx],
        _current_tx_index: usize,
    ) -> Self { ... }
    fn refresh_journal<J>(&self, _journal: &mut J)
       where J: FoundryJournal { ... }
    fn clear_transaction_fee_cache(&mut self) { ... }
}
Expand description

Foundry extension for chain context type

Every family that doesn’t need chain metadata uses ().

Provided Methods§

fn for_transaction(_tx: &Tx) -> Self

Builds chain context for a standalone synthetic transaction.

fn for_block( _grandparent: &[Tx], _parent: &[Tx], _current: &[Tx], _current_tx_index: usize, ) -> Self

Builds chain context for a transaction at an exact block position.

fn refresh_journal<J>(&self, _journal: &mut J)
where J: FoundryJournal,

Available on crate feature monad only.

Refreshes journal state derived from the active chain position.

fn clear_transaction_fee_cache(&mut self)

Clears cached protocol fees after a synthetic transaction restores chain context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl FoundryChain<BaseTransaction<TxEnv>> for L1BlockInfo

§

impl FoundryChain<OpTx> for L1BlockInfo

§

impl FoundryChain<TxEnv> for MonadChainContext

§

fn for_transaction(tx: &TxEnv) -> MonadChainContext

§

fn for_block( grandparent: &[TxEnv], parent: &[TxEnv], current: &[TxEnv], current_tx_index: usize, ) -> MonadChainContext

§

fn refresh_journal<J>(&self, journal: &mut J)
where J: FoundryJournal,

Available on crate feature monad only.
§

impl<Tx> FoundryChain<Tx> for ()

Implementors§