Struct chain_impl_mockchain::stake::PoolsState
source · pub struct PoolsState {
pub(crate) stake_pools: Hamt<DefaultHasher, PoolId, PoolState>,
}
Expand description
A structure that keeps track of stake keys and stake pools.
Fields§
§stake_pools: Hamt<DefaultHasher, PoolId, PoolState>
Implementations§
source§impl PoolsState
impl PoolsState
pub fn new() -> Self
pub fn lookup(&self, id: &PoolId) -> Option<&PoolState>
pub fn lookup_reg(&self, id: &PoolId) -> Option<&PoolRegistration>
pub fn stake_pool_ids(&self) -> impl Iterator<Item = PoolId> + '_
pub fn stake_pool_exists(&self, pool_id: &PoolId) -> bool
pub fn stake_pool_get_state( &self, pool_id: &PoolId ) -> Result<&PoolState, PoolError>
pub fn stake_pool_set_state( &mut self, pool_id: &PoolId, pool_state: PoolState ) -> Result<(), PoolError>
pub fn stake_pool_get( &self, pool_id: &PoolId ) -> Result<&PoolRegistration, PoolError>
pub fn stake_pool_set_rewards( &mut self, pool_id: &PoolId, epoch: Epoch, value_taxed: Value, value_for_stakers: Value ) -> Result<(), PoolError>
pub fn register_stake_pool( &self, owner: PoolRegistration ) -> Result<Self, PoolError>
pub fn deregister_stake_pool(&self, pool_id: &PoolId) -> Result<Self, PoolError>
Trait Implementations§
source§impl Clone for PoolsState
impl Clone for PoolsState
source§fn clone(&self) -> PoolsState
fn clone(&self) -> PoolsState
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 PoolsState
impl Debug for PoolsState
source§impl Default for PoolsState
impl Default for PoolsState
source§fn default() -> PoolsState
fn default() -> PoolsState
Returns the “default value” for a type. Read more
source§impl PartialEq<PoolsState> for PoolsState
impl PartialEq<PoolsState> for PoolsState
source§fn eq(&self, other: &PoolsState) -> bool
fn eq(&self, other: &PoolsState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PoolsState
impl StructuralEq for PoolsState
impl StructuralPartialEq for PoolsState
Auto Trait Implementations§
impl RefUnwindSafe for PoolsState
impl Send for PoolsState
impl Sync for PoolsState
impl Unpin for PoolsState
impl UnwindSafe for PoolsState
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