mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 21:27:57 +00:00
Make perthings operate in type operator (#2501)
* perthings operate in type operator * implementation with rem * fmt * doc * better fmt * bump version * Tests for pet-things * demonstrate output as type of operation * Remove redundant assertions. * rename test * update lock * bump impl version
This commit is contained in:
@@ -434,9 +434,9 @@ decl_storage! {
|
||||
/// The length of a staking era in sessions.
|
||||
pub SessionsPerEra get(sessions_per_era) config(): T::BlockNumber = T::BlockNumber::sa(1000);
|
||||
/// Maximum reward, per validator, that is provided per acceptable session.
|
||||
pub SessionReward get(session_reward) config(): Perbill = Perbill::from_billionths(60);
|
||||
pub SessionReward get(session_reward) config(): Perbill = Perbill::from_parts(60);
|
||||
/// Slash, per validator that is taken for the first time they are found to be offline.
|
||||
pub OfflineSlash get(offline_slash) config(): Perbill = Perbill::from_millionths(1000); // Perbill::from_fraction() is only for std, so use from_millionths().
|
||||
pub OfflineSlash get(offline_slash) config(): Perbill = Perbill::from_millionths(1000);
|
||||
/// Number of instances of offline reports before slashing begins for validators.
|
||||
pub OfflineSlashGrace get(offline_slash_grace) config(): u32;
|
||||
/// The length of the bonding duration in eras.
|
||||
|
||||
@@ -180,7 +180,7 @@ pub fn elect<T: Trait + 'static, FV, FN, FS>(
|
||||
let temp =
|
||||
n.budget.saturating_mul(SCALE_FACTOR) / c.approval_stake
|
||||
* (*n.load / SCALE_FACTOR);
|
||||
c.score = Fraction::from_max_value((*c.score).saturating_add(temp));
|
||||
c.score = Fraction::from_parts((*c.score).saturating_add(temp));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ pub fn elect<T: Trait + 'static, FV, FN, FS>(
|
||||
for n in &mut nominators {
|
||||
for e in &mut n.edges {
|
||||
if e.who == winner.who {
|
||||
e.load = Fraction::from_max_value(*winner.score - *n.load);
|
||||
e.load = Fraction::from_parts(*winner.score - *n.load);
|
||||
n.load = winner.score;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user