pub struct Producer<Database> {
pub config: Config,
pub db: Database,
pub txpool: Box<dyn TxPool>,
pub executor: Arc<dyn Executor<Database>>,
pub relayer: Box<dyn Relayer>,
pub lock: Mutex<()>,
pub dry_run_semaphore: Semaphore,
}
Fields§
§config: Config
§db: Database
§txpool: Box<dyn TxPool>
§executor: Arc<dyn Executor<Database>>
§relayer: Box<dyn Relayer>
§lock: Mutex<()>
§dry_run_semaphore: Semaphore
Implementations§
Source§impl<Database> Producer<Database>where
Database: BlockProducerDatabase + 'static,
impl<Database> Producer<Database>where
Database: BlockProducerDatabase + 'static,
Sourcepub async fn produce_and_execute_block(
&self,
height: BlockHeight,
max_gas: Word,
) -> Result<UncommittedResult<DBTransaction<Database>>>
pub async fn produce_and_execute_block( &self, height: BlockHeight, max_gas: Word, ) -> Result<UncommittedResult<DBTransaction<Database>>>
Produces and execute block for the specified height
Sourcepub async fn dry_run(
&self,
transaction: Transaction,
height: Option<BlockHeight>,
utxo_validation: Option<bool>,
) -> Result<Vec<Receipt>>
pub async fn dry_run( &self, transaction: Transaction, height: Option<BlockHeight>, utxo_validation: Option<bool>, ) -> Result<Vec<Receipt>>
Simulate a transaction without altering any state. Does not aquire the production lock since it is basically a “read only” operation and shouldn’t get in the way of normal production.
Auto Trait Implementations§
impl<Database> !Freeze for Producer<Database>
impl<Database> !RefUnwindSafe for Producer<Database>
impl<Database> Send for Producer<Database>where
Database: Send,
impl<Database> Sync for Producer<Database>where
Database: Sync,
impl<Database> Unpin for Producer<Database>where
Database: Unpin,
impl<Database> !UnwindSafe for Producer<Database>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more