Struct oasis_core_runtime::consensus::state::staking::ImmutableState
source · pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description
Consensus staking state wrapper.
Implementations§
source§impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>
impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>
sourcepub fn new(mkvs: &'a T) -> ImmutableState<'a, T>
pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>
Constructs a new ImmutableMKVS.
source§impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>
impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>
sourcepub fn account(&self, address: Address) -> Result<Account, StateError>
pub fn account(&self, address: Address) -> Result<Account, StateError>
Returns the staking account for the given account address.
sourcepub fn total_supply(&self) -> Result<Quantity, StateError>
pub fn total_supply(&self) -> Result<Quantity, StateError>
Returns the total supply.
sourcepub fn common_pool(&self) -> Result<Quantity, StateError>
pub fn common_pool(&self) -> Result<Quantity, StateError>
Returns the balance of the global common pool.
sourcepub fn last_block_fees(&self) -> Result<Quantity, StateError>
pub fn last_block_fees(&self) -> Result<Quantity, StateError>
Returns the last block fees balance.
sourcepub fn governance_deposits(&self) -> Result<Quantity, StateError>
pub fn governance_deposits(&self) -> Result<Quantity, StateError>
Returns the governance deposits balance.
sourcepub fn addresses(&self) -> Result<Vec<Address>, StateError>
pub fn addresses(&self) -> Result<Vec<Address>, StateError>
Returns the non-empty addresses from the staking ledger.
sourcepub fn delegation(
&self,
delegator_addr: Address,
escrow_addr: Address,
) -> Result<Delegation, StateError>
pub fn delegation( &self, delegator_addr: Address, escrow_addr: Address, ) -> Result<Delegation, StateError>
Returns the delegation.
sourcepub fn delegations(
&self,
) -> Result<BTreeMap<Address, BTreeMap<Address, Delegation>>, StateError>
pub fn delegations( &self, ) -> Result<BTreeMap<Address, BTreeMap<Address, Delegation>>, StateError>
Returns all active delegations.
sourcepub fn debonding_delegation(
&self,
delegator_addr: Address,
escrow_addr: Address,
epoch: EpochTime,
) -> Result<DebondingDelegation, StateError>
pub fn debonding_delegation( &self, delegator_addr: Address, escrow_addr: Address, epoch: EpochTime, ) -> Result<DebondingDelegation, StateError>
Returns the debonding delegation.
sourcepub fn debonding_delegations(
&self,
) -> Result<BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>>, StateError>
pub fn debonding_delegations( &self, ) -> Result<BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>>, StateError>
Returns all debonding delegations.
Auto Trait Implementations§
impl<'a, T> Freeze for ImmutableState<'a, T>
impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ImmutableState<'a, T>where
T: Sync,
impl<'a, T> Sync for ImmutableState<'a, T>where
T: Sync,
impl<'a, T> Unpin for ImmutableState<'a, T>
impl<'a, T> UnwindSafe for ImmutableState<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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