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

source

pub fn apply_transaction(&mut self, fragment: Fragment) -> Result<(), Error>

source

pub fn apply_fragment( &mut self, fragment: &Fragment, date: BlockDate ) -> Result<(), Error>

source

pub fn apply_block(&mut self, block: Block) -> Result<(), Error>

source

pub fn apply_protocol_changes(&mut self) -> Result<(), Error>

source

pub fn total_funds(&self) -> Value

source

pub fn find_utxo_for_address<'a>( &'a self, address_data: &AddressData ) -> Option<Entry<'a, Address>>

source

pub fn accounts(&self) -> &AccountLedger

source

pub fn block0_hash(&self) -> &HeaderId

source

pub fn faucets(&self) -> Vec<AddressDataValue>

source

pub fn utxos(&self) -> Iter<'_, Address>

source

pub fn fee(&self) -> LinearFee

source

pub fn chain_length(&self) -> ChainLength

source

pub fn era(&self) -> &TimeEra

source

pub fn delegation(&self) -> PoolsState

source

pub fn date(&self) -> BlockDate

source

pub fn set_date(&mut self, date: BlockDate)

source

pub fn leaders_log(&self) -> LeadersParticipationRecord

source

pub fn leaders_log_for(&self, pool_id: &PoolId) -> u32

source

pub fn increase_leader_log(&mut self, pool_id: &PoolId)

source

pub fn distribute_rewards(&mut self) -> Result<(), Error>

source

pub fn forge_empty_block(&self, stake_pool: &StakePool) -> Block

source

pub fn apply_empty_praos_block( &mut self, stake_pool: &StakePool ) -> Result<(), Error>

source

pub fn settings(&self) -> &Settings

source

pub fn apply_praos_block( &mut self, stake_pool: &StakePool, fragments: Vec<Fragment> ) -> Result<(), Error>

source

pub fn forge_praos_block_with_fragments( &self, stake_pool: &StakePool, fragments: Vec<Fragment> ) -> Block

source

pub fn apply_empty_bft_block( &mut self, leader_pair: &LeaderPair ) -> Result<(), Error>

source

pub fn apply_empty_bft_block_with_date( &mut self, leader_pair: &LeaderPair, block_date: BlockDate ) -> Result<(), Error>

source

pub fn forge_bft_block_with_fragments( &self, bft_leader: &LeaderPair, block_date: BlockDate, fragments: Vec<Fragment> ) -> Block

source

pub fn forward_date(&mut self)

source

pub fn can_distribute_reward(&self) -> bool

source

pub fn fast_forward_to(&mut self, date: BlockDate)

source

pub fn fire_leadership_event( &mut self, stake_pools: Vec<StakePool>, fragments: Vec<Fragment> ) -> Result<bool, Error>

source

pub fn pots(&self) -> Pots

Trait Implementations§

source§

impl Arbitrary for TestLedger

source§

fn arbitrary<G: Gen>(g: &mut G) -> Self

§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>, Global>

source§

impl Clone for TestLedger

source§

fn clone(&self) -> TestLedger

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TestLedger

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<TestLedger> for Ledger

source§

fn from(from: TestLedger) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more