mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Move EraIndex to sp-staking (#10671)
* Move `EraIndex` to sp-staking * Fix imports in mocks * Run cargo +nightly-2021-10-29 fmt
This commit is contained in:
@@ -312,7 +312,7 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_staking::{
|
||||
offence::{Offence, OffenceError, ReportOffence},
|
||||
SessionIndex,
|
||||
EraIndex, SessionIndex,
|
||||
};
|
||||
use sp_std::{collections::btree_map::BTreeMap, convert::From, prelude::*};
|
||||
pub use weights::WeightInfo;
|
||||
@@ -332,9 +332,6 @@ macro_rules! log {
|
||||
};
|
||||
}
|
||||
|
||||
/// Counter for the number of eras that have passed.
|
||||
pub type EraIndex = u32;
|
||||
|
||||
/// Counter for the number of "reward" points earned by a given validator.
|
||||
pub type RewardPoint = u32;
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_staking::{
|
||||
offence::{DisableStrategy, OffenceDetails, OnOffenceHandler},
|
||||
SessionIndex,
|
||||
EraIndex, SessionIndex,
|
||||
};
|
||||
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
|
||||
|
||||
use crate::{
|
||||
log, slashing, weights::WeightInfo, ActiveEraInfo, BalanceOf, EraIndex, EraPayout, Exposure,
|
||||
ExposureOf, Forcing, IndividualExposure, Nominations, PositiveImbalanceOf, RewardDestination,
|
||||
log, slashing, weights::WeightInfo, ActiveEraInfo, BalanceOf, EraPayout, Exposure, ExposureOf,
|
||||
Forcing, IndividualExposure, Nominations, PositiveImbalanceOf, RewardDestination,
|
||||
SessionInterface, StakingLedger, ValidatorPrefs,
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use sp_runtime::{
|
||||
traits::{CheckedSub, SaturatedConversion, StaticLookup, Zero},
|
||||
DispatchError, Perbill, Percent,
|
||||
};
|
||||
use sp_staking::SessionIndex;
|
||||
use sp_staking::{EraIndex, SessionIndex};
|
||||
use sp_std::{convert::From, prelude::*, result};
|
||||
|
||||
mod impls;
|
||||
@@ -39,7 +39,7 @@ mod impls;
|
||||
pub use impls::*;
|
||||
|
||||
use crate::{
|
||||
log, migrations, slashing, weights::WeightInfo, ActiveEraInfo, BalanceOf, EraIndex, EraPayout,
|
||||
log, migrations, slashing, weights::WeightInfo, ActiveEraInfo, BalanceOf, EraPayout,
|
||||
EraRewardPoints, Exposure, Forcing, NegativeImbalanceOf, Nominations, PositiveImbalanceOf,
|
||||
Releases, RewardDestination, SessionInterface, StakingLedger, UnappliedSlash, UnlockChunk,
|
||||
ValidatorPrefs,
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
//! Based on research at <https://research.web3.foundation/en/latest/polkadot/slashing/npos.html>
|
||||
|
||||
use crate::{
|
||||
BalanceOf, Config, EraIndex, Error, Exposure, NegativeImbalanceOf, Pallet, Perbill,
|
||||
SessionInterface, Store, UnappliedSlash,
|
||||
BalanceOf, Config, Error, Exposure, NegativeImbalanceOf, Pallet, Perbill, SessionInterface,
|
||||
Store, UnappliedSlash,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
@@ -63,7 +63,7 @@ use sp_runtime::{
|
||||
traits::{Saturating, Zero},
|
||||
DispatchResult, RuntimeDebug,
|
||||
};
|
||||
use sp_staking::offence::DisableStrategy;
|
||||
use sp_staking::{offence::DisableStrategy, EraIndex};
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// The proportion of the slashing reward to be paid out on the first slashing detection.
|
||||
|
||||
Reference in New Issue
Block a user