pub trait TxHooks {
    type Context: Context;

    // Required methods
    fn pre_dispatch_tx_hook(
        &self,
        tx: Transaction<Self::Context>,
        working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
    ) -> Result<<Self::Context as Spec>::Address>;
    fn post_dispatch_tx_hook(
        &self,
        tx: &Transaction<Self::Context>,
        working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
    ) -> Result<()>;
}
Expand description

Hooks that execute within the StateTransitionFunction::apply_blob function for each processed transaction.

Required Associated Types§

Required Methods§

source

fn pre_dispatch_tx_hook( &self, tx: Transaction<Self::Context>, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<<Self::Context as Spec>::Address>

Runs just before a transaction is dispatched to an appropriate module.

source

fn post_dispatch_tx_hook( &self, tx: &Transaction<Self::Context>, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<()>

Runs after the tx is dispatched to an appropriate module.

Implementors§