Struct chain_impl_mockchain::testing::ledger::TestLedger
source · pub struct TestLedger {
pub block0_hash: HeaderId,
pub cfg: ConfigParams,
pub faucets: Vec<AddressDataValue>,
pub ledger: Ledger,
pub utxodb: UtxoDb,
}
Fields§
§block0_hash: HeaderId
§cfg: ConfigParams
§faucets: Vec<AddressDataValue>
§ledger: Ledger
§utxodb: UtxoDb
Implementations§
source§impl TestLedger
impl TestLedger
pub fn apply_transaction(&mut self, fragment: Fragment) -> Result<(), Error>
pub fn apply_fragment( &mut self, fragment: &Fragment, date: BlockDate ) -> Result<(), Error>
pub fn apply_block(&mut self, block: Block) -> Result<(), Error>
pub fn apply_protocol_changes(&mut self) -> Result<(), Error>
pub fn total_funds(&self) -> Value
pub fn find_utxo_for_address<'a>( &'a self, address_data: &AddressData ) -> Option<Entry<'a, Address>>
pub fn accounts(&self) -> &AccountLedger
pub fn block0_hash(&self) -> &HeaderId
pub fn faucets(&self) -> Vec<AddressDataValue>
pub fn utxos(&self) -> Iter<'_, Address> ⓘ
pub fn fee(&self) -> LinearFee
pub fn chain_length(&self) -> ChainLength
pub fn era(&self) -> &TimeEra
pub fn delegation(&self) -> PoolsState
pub fn date(&self) -> BlockDate
pub fn set_date(&mut self, date: BlockDate)
pub fn leaders_log(&self) -> LeadersParticipationRecord
pub fn leaders_log_for(&self, pool_id: &PoolId) -> u32
pub fn increase_leader_log(&mut self, pool_id: &PoolId)
pub fn distribute_rewards(&mut self) -> Result<(), Error>
pub fn forge_empty_block(&self, stake_pool: &StakePool) -> Block
pub fn apply_empty_praos_block( &mut self, stake_pool: &StakePool ) -> Result<(), Error>
pub fn settings(&self) -> &Settings
pub fn apply_praos_block( &mut self, stake_pool: &StakePool, fragments: Vec<Fragment> ) -> Result<(), Error>
pub fn forge_praos_block_with_fragments( &self, stake_pool: &StakePool, fragments: Vec<Fragment> ) -> Block
pub fn apply_empty_bft_block( &mut self, leader_pair: &LeaderPair ) -> Result<(), Error>
pub fn apply_empty_bft_block_with_date( &mut self, leader_pair: &LeaderPair, block_date: BlockDate ) -> Result<(), Error>
pub fn forge_bft_block_with_fragments( &self, bft_leader: &LeaderPair, block_date: BlockDate, fragments: Vec<Fragment> ) -> Block
pub fn forward_date(&mut self)
pub fn can_distribute_reward(&self) -> bool
pub fn fast_forward_to(&mut self, date: BlockDate)
pub fn fire_leadership_event( &mut self, stake_pools: Vec<StakePool>, fragments: Vec<Fragment> ) -> Result<bool, Error>
pub fn pots(&self) -> Pots
Trait Implementations§
source§impl Arbitrary for TestLedger
impl Arbitrary for TestLedger
source§impl Clone for TestLedger
impl Clone for TestLedger
source§fn clone(&self) -> TestLedger
fn clone(&self) -> TestLedger
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TestLedger
impl Debug for TestLedger
source§impl From<TestLedger> for Ledger
impl From<TestLedger> for Ledger
source§fn from(from: TestLedger) -> Self
fn from(from: TestLedger) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for TestLedger
impl Send for TestLedger
impl Sync for TestLedger
impl Unpin for TestLedger
impl UnwindSafe for TestLedger
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