pub struct InMemoryStakingStore { /* private fields */ }Expand description
In-memory staking store for testing and demos.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryStakingStore
impl Default for InMemoryStakingStore
Source§fn default() -> InMemoryStakingStore
fn default() -> InMemoryStakingStore
Returns the “default value” for a type. Read more
Source§impl StakingStore for InMemoryStakingStore
impl StakingStore for InMemoryStakingStore
fn get_validator(&self, id: ValidatorId) -> Option<ValidatorState>
fn set_validator(&mut self, id: ValidatorId, state: ValidatorState)
fn remove_validator(&mut self, id: ValidatorId)
fn all_validator_ids(&self) -> Vec<ValidatorId>
fn get_stake(&self, staker: &[u8], validator: ValidatorId) -> Option<StakeEntry>
fn set_stake( &mut self, staker: &[u8], validator: ValidatorId, entry: StakeEntry, )
fn remove_stake(&mut self, staker: &[u8], validator: ValidatorId)
Source§fn stakers_of(&self, validator: ValidatorId) -> Vec<(Vec<u8>, StakeEntry)>
fn stakers_of(&self, validator: ValidatorId) -> Vec<(Vec<u8>, StakeEntry)>
Return all (staker_address, entry) pairs for a given validator.
Source§fn push_unbonding(&mut self, entry: UnbondingEntry)
fn push_unbonding(&mut self, entry: UnbondingEntry)
Append an entry to the unbonding queue.
Source§fn drain_mature_unbondings(
&mut self,
current_height: u64,
) -> Vec<UnbondingEntry>
fn drain_mature_unbondings( &mut self, current_height: u64, ) -> Vec<UnbondingEntry>
Remove and return all entries whose
completion_height <= current_height.Source§fn all_unbondings(&self) -> Vec<UnbondingEntry>
fn all_unbondings(&self) -> Vec<UnbondingEntry>
Return all pending unbonding entries (for slashing).
Source§fn replace_unbondings(&mut self, entries: Vec<UnbondingEntry>)
fn replace_unbondings(&mut self, entries: Vec<UnbondingEntry>)
Replace the entire unbonding queue (used after slashing adjustments).
Auto Trait Implementations§
impl Freeze for InMemoryStakingStore
impl RefUnwindSafe for InMemoryStakingStore
impl Send for InMemoryStakingStore
impl Sync for InMemoryStakingStore
impl Unpin for InMemoryStakingStore
impl UnsafeUnpin for InMemoryStakingStore
impl UnwindSafe for InMemoryStakingStore
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