mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
Update substrate (#878)
* Switch branch * Small changes * Update substrate branch * Switch * Revert "Switch branch" This reverts commit b9d48b2ce8f5cbfa379dd385e817e80870391d9d. * fix * add `wipe` and `commit` * Remove deprecated_host_interface * Switch branch * HasherFor -> HashFor * More HasherFor changes * Final touches * Revert "Switch branch" This reverts commit d0da27313839559de01f59690f3826fe587becb8. Co-authored-by: thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -75,11 +75,19 @@ impl RewardAttestation for () {
|
||||
|
||||
impl<T: staking::Trait> RewardAttestation for staking::Module<T> {
|
||||
fn reward_immediate(validator_indices: impl IntoIterator<Item=u32>) {
|
||||
use staking::SessionInterface;
|
||||
|
||||
// The number of points to reward for a validity statement.
|
||||
// https://research.web3.foundation/en/latest/polkadot/Token%20Economics/#payment-details
|
||||
const STAKING_REWARD_POINTS: u32 = 20;
|
||||
|
||||
Self::reward_by_indices(validator_indices.into_iter().map(|i| (i, STAKING_REWARD_POINTS)))
|
||||
let validators = T::SessionInterface::validators();
|
||||
|
||||
let validator_rewards = validator_indices.into_iter()
|
||||
.filter_map(|i| validators.get(i as usize).cloned())
|
||||
.map(|v| (v, STAKING_REWARD_POINTS));
|
||||
|
||||
Self::reward_by_ids(validator_rewards);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user