SequencingHooks

Trait SequencingHooks 

Source
pub trait SequencingHooks {
    // Required methods
    fn next_tx_to_sequence(&mut self) -> Option<Vec<u8>>;
    fn pre_tx_filter(&self, tx: &[u8]) -> Result<(), String>;
    fn post_tx_filter(&self, tx: &[u8], result: &[u8]) -> Result<(), String>;
    fn discard_invalid_txs_early(&self) -> bool;

    // Provided methods
    fn block_filter(
        &self,
        _header: &NewHeaderResult,
        _txs: &[Vec<u8>],
        _receipts: &[Vec<u8>],
    ) -> Result<(), String> { ... }
    fn insert_last_tx_error(&mut self, _err: String) { ... }
}
Expand description

Hooks for the sequencer to control block production.

Required Methods§

Source

fn next_tx_to_sequence(&mut self) -> Option<Vec<u8>>

Returns the next transaction to include, or None if the block is complete.

Source

fn pre_tx_filter(&self, tx: &[u8]) -> Result<(), String>

Filters a transaction before execution.

Source

fn post_tx_filter(&self, tx: &[u8], result: &[u8]) -> Result<(), String>

Filters a transaction after execution.

Source

fn discard_invalid_txs_early(&self) -> bool

Determines whether to discard invalid txs early.

Provided Methods§

Source

fn block_filter( &self, _header: &NewHeaderResult, _txs: &[Vec<u8>], _receipts: &[Vec<u8>], ) -> Result<(), String>

Block-level filter applied after all transactions are processed.

Source

fn insert_last_tx_error(&mut self, _err: String)

Inserts the error for the last tx.

Implementors§