Skip to main content

BatchBuilder

Trait BatchBuilder 

Source
pub trait BatchBuilder {
    // Required methods
    fn accept_tx(&mut self, tx: Vec<u8>) -> Result<()>;
    fn get_next_blob(&mut self) -> Result<Vec<Vec<u8>>>;
}
Expand description

BlockBuilder trait is responsible for managing mempool and building batches.

Required Methods§

Source

fn accept_tx(&mut self, tx: Vec<u8>) -> Result<()>

Accept a new transaction. Can return error if transaction is invalid or mempool is full.

Source

fn get_next_blob(&mut self) -> Result<Vec<Vec<u8>>>

Builds a new batch out of transactions in mempool. Logic of which transactions and how many of them is included in batch is up to implementation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§