pub struct MockChain<'a> { /* private fields */ }Implementations§
Source§impl<'a> MockChain<'a>
impl<'a> MockChain<'a>
pub fn new(parent: HeaderView, consensus: &'a Consensus) -> Self
pub fn rollback(&mut self, store: &MockStore)
pub fn gen_block_with_proposal_txs( &mut self, txs: Vec<TransactionView>, store: &MockStore, )
pub fn gen_block_with_proposal_ids( &mut self, difficulty: u64, ids: Vec<ProposalShortId>, store: &MockStore, )
pub fn gen_empty_block_with_diff(&mut self, difficulty: u64, store: &MockStore)
pub fn gen_empty_block_with_inc_diff(&mut self, inc: u64, store: &MockStore)
pub fn gen_empty_block_with_nonce(&mut self, nonce: u128, store: &MockStore)
pub fn gen_empty_block(&mut self, store: &MockStore)
pub fn gen_block_with_commit_txs( &mut self, txs: Vec<TransactionView>, store: &MockStore, ignore_resolve_error: bool, )
pub fn tip_header(&self) -> HeaderView
pub fn tip(&self) -> &BlockView
pub fn difficulty(&self) -> U256
pub fn blocks(&self) -> &Vec<BlockView>
pub fn total_difficulty(&self) -> U256
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for MockChain<'a>
impl<'a> RefUnwindSafe for MockChain<'a>
impl<'a> Send for MockChain<'a>
impl<'a> Sync for MockChain<'a>
impl<'a> Unpin for MockChain<'a>
impl<'a> UnsafeUnpin for MockChain<'a>
impl<'a> UnwindSafe for MockChain<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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