pub struct Controller {
    pub block0_hash: Hash,
    pub declared_wallets: Vec<Wallet>,
    pub declared_stake_pools: Vec<StakePool>,
    pub declared_vote_plans: Vec<VotePlanDef>,
    fragment_factory: FragmentFactory,
}

Fields§

§block0_hash: Hash§declared_wallets: Vec<Wallet>§declared_stake_pools: Vec<StakePool>§declared_vote_plans: Vec<VotePlanDef>§fragment_factory: FragmentFactory

Implementations§

source§

impl Controller

source

pub fn new( block0_hash: Hash, fee: LinearFee, declared_wallets: Vec<Wallet>, declared_stake_pools: Vec<StakePool>, declared_vote_plans: Vec<VotePlanDef> ) -> Self

source

pub fn wallets(&self) -> Vec<Wallet>

source

pub fn wallet(&self, alias: &str) -> Result<Wallet, ControllerError>

source

pub fn vote_plan(&self, alias: &str) -> Result<VotePlanDef, ControllerError>

source

pub fn initial_stake_pools(&self) -> Vec<StakePool>

source

pub fn stake_pool(&self, alias: &str) -> Result<StakePool, ControllerError>

source

pub fn fragment_factory(&self) -> FragmentFactory

source

pub fn transfer_funds( &self, from: &Wallet, to: &Wallet, test_ledger: &mut TestLedger, funds: u64 ) -> Result<(), LedgerError>

source

pub fn register( &self, funder: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn delegates( &self, from: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn delegates_different_funder( &self, funder: &Wallet, delegation: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn removes_delegation( &self, from: &Wallet, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn delegates_to_many( &self, from: &Wallet, distribution: &[(&StakePool, u8)], test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn owner_delegates( &self, from: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn retire<'a>( &'a self, owners: impl IntoIterator<Item = &'a Wallet>, stake_pool: &'a StakePool, test_ledger: &'a mut TestLedger ) -> Result<(), LedgerError>

source

pub fn update<'a>( &'a self, stake_pool: &'a StakePool, update: StakePool, owners: impl IntoIterator<Item = &'a Wallet>, test_ledger: &'a mut TestLedger ) -> Result<(), LedgerError>

source

pub fn cast_vote_public( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, id: &ExternalProposalId, choice: Choice, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn cast_vote_private<R>( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, id: &ExternalProposalId, choice: Choice, test_ledger: &mut TestLedger, rng: &mut R ) -> Result<(), LedgerError>where R: RngCore + CryptoRng,

source

fn cast_vote<F>( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, id: &ExternalProposalId, test_ledger: &mut TestLedger, payload_producer: F ) -> Result<(), LedgerError>where F: FnMut(&VotePlan, &Proposal) -> Payload,

source

pub fn tally_vote_public( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn tally_vote_private( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, decrypted_tally: DecryptedPrivateTally, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn update_proposal( &self, owner: &Wallet, update_proposal: UpdateProposal, test_ledger: &mut TestLedger ) -> Result<FragmentId, LedgerError>

source

pub fn update_vote( &self, owner: &Wallet, update_vote: UpdateVote, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

source

pub fn mint_token( &self, owner: &Wallet, mint_token: MintToken, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>

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, 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