Struct mainnet_lib::Ledger
source · pub struct Ledger {
mempool: Vec<Transaction>,
blocks: Vec<Block>,
settings: Settings,
}
Expand description
Simulates cardano node behavior. Contains mempool of transactions as well as blockchain. Meant to be used as library in current thread.
Fields§
§mempool: Vec<Transaction>
§blocks: Vec<Block>
§settings: Settings
Implementations§
source§impl Ledger
impl Ledger
sourcepub fn push_transactions(&mut self, transactions: Vec<Transaction>)
pub fn push_transactions(&mut self, transactions: Vec<Transaction>)
Adds transactions to mempool
sourcepub fn push_transaction(&mut self, transaction: Transaction)
pub fn push_transaction(&mut self, transaction: Transaction)
Add transaction to mempool
sourcepub fn mint_block(&mut self) -> Result<Block, Error>
pub fn mint_block(&mut self) -> Result<Block, Error>
sourcepub fn blockchain(&self) -> &[Block]
pub fn blockchain(&self) -> &[Block]
Retrieves blockchain in form of vector of blocks
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Ledger
impl Sync for Ledger
impl Unpin for Ledger
impl UnwindSafe for Ledger
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request