Struct chain_impl_mockchain::testing::scenario::Controller
source · 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
impl Controller
pub fn new( block0_hash: Hash, fee: LinearFee, declared_wallets: Vec<Wallet>, declared_stake_pools: Vec<StakePool>, declared_vote_plans: Vec<VotePlanDef> ) -> Self
pub fn wallets(&self) -> Vec<Wallet>
pub fn wallet(&self, alias: &str) -> Result<Wallet, ControllerError>
pub fn vote_plan(&self, alias: &str) -> Result<VotePlanDef, ControllerError>
pub fn initial_stake_pools(&self) -> Vec<StakePool>
pub fn stake_pool(&self, alias: &str) -> Result<StakePool, ControllerError>
pub fn fragment_factory(&self) -> FragmentFactory
pub fn transfer_funds( &self, from: &Wallet, to: &Wallet, test_ledger: &mut TestLedger, funds: u64 ) -> Result<(), LedgerError>
pub fn register( &self, funder: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn delegates( &self, from: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn delegates_different_funder( &self, funder: &Wallet, delegation: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn removes_delegation( &self, from: &Wallet, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn delegates_to_many( &self, from: &Wallet, distribution: &[(&StakePool, u8)], test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn owner_delegates( &self, from: &Wallet, stake_pool: &StakePool, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn retire<'a>( &'a self, owners: impl IntoIterator<Item = &'a Wallet>, stake_pool: &'a StakePool, test_ledger: &'a mut TestLedger ) -> Result<(), LedgerError>
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>
pub fn cast_vote_public( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, id: &ExternalProposalId, choice: Choice, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
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,
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,
pub fn tally_vote_public( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn tally_vote_private( &self, owner: &Wallet, vote_plan_def: &VotePlanDef, decrypted_tally: DecryptedPrivateTally, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn update_proposal( &self, owner: &Wallet, update_proposal: UpdateProposal, test_ledger: &mut TestLedger ) -> Result<FragmentId, LedgerError>
pub fn update_vote( &self, owner: &Wallet, update_vote: UpdateVote, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
pub fn mint_token( &self, owner: &Wallet, mint_token: MintToken, test_ledger: &mut TestLedger ) -> Result<(), LedgerError>
Auto Trait Implementations§
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnwindSafe for Controller
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