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§
Sourcefn next_tx_to_sequence(&mut self) -> Option<Vec<u8>>
fn next_tx_to_sequence(&mut self) -> Option<Vec<u8>>
Returns the next transaction to include, or None if the block is complete.
Sourcefn pre_tx_filter(&self, tx: &[u8]) -> Result<(), String>
fn pre_tx_filter(&self, tx: &[u8]) -> Result<(), String>
Filters a transaction before execution.
Sourcefn post_tx_filter(&self, tx: &[u8], result: &[u8]) -> Result<(), String>
fn post_tx_filter(&self, tx: &[u8], result: &[u8]) -> Result<(), String>
Filters a transaction after execution.
Sourcefn discard_invalid_txs_early(&self) -> bool
fn discard_invalid_txs_early(&self) -> bool
Determines whether to discard invalid txs early.
Provided Methods§
Sourcefn block_filter(
&self,
_header: &NewHeaderResult,
_txs: &[Vec<u8>],
_receipts: &[Vec<u8>],
) -> Result<(), String>
fn block_filter( &self, _header: &NewHeaderResult, _txs: &[Vec<u8>], _receipts: &[Vec<u8>], ) -> Result<(), String>
Block-level filter applied after all transactions are processed.
Sourcefn insert_last_tx_error(&mut self, _err: String)
fn insert_last_tx_error(&mut self, _err: String)
Inserts the error for the last tx.