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:
Gavin Wood
2020-03-05 13:27:28 +01:00
committed by GitHub
parent 1058537824
commit b2df51d296
19 changed files with 1392 additions and 1308 deletions
+9 -1
View File
@@ -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);
}
}