Expose properties and per-era preferences

This commit is contained in:
Demi M. Obenour
2020-08-11 21:24:46 -04:00
parent 7bad6c6909
commit da3667572b
4 changed files with 52 additions and 5 deletions
+19 -2
View File
@@ -38,6 +38,11 @@ use std::{
marker::PhantomData,
};
pub use pallet_staking::{
EraIndex,
StakingLedger,
};
/// A record of the nominations made by a specific account.
#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, Ord, PartialOrd, Hash)]
pub struct Nominations<T: Staking> {
@@ -51,6 +56,20 @@ pub struct Nominations<T: Staking> {
pub suppressed: bool,
}
/// Similar to `ErasStakers`, this holds the preferences of validators.
///
/// This is keyed first by the era index to allow bulk deletion and then the stash account.
///
/// Is it removed after `HISTORY_DEPTH` eras.
#[derive(Encode, Decode, Debug, Store)]
pub struct ErasValidatorPrefsStore<T: Staking> {
#[store(returns = ValidatorPrefs)]
/// Era index
index: EraIndex,
/// Account ID
account_id: T::AccountId,
}
/// Information regarding the active era (era in used in session).
#[derive(Encode, Decode, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ActiveEraInfo<T: Staking> {
@@ -161,8 +180,6 @@ pub struct UnlockChunk<T: Staking> {
pub era: T::EraIndex,
}
pub use pallet_staking::StakingLedger;
/// Number of eras to keep in history.
///
/// Information is kept for eras in `[current_era - history_depth; current_era]`.