Reward validators for participating in parachains (#2089)

* plumbing for rewarding backers

* give validators reward points for participating

* fix tests

* add bitfield rewarding

* add mocks for backing rewards

* add testing for backing & availability rewards

* implement RewardValidators on top of staking

* add to test-runtime and rococo

* add to test-runtime & rococo

* point to source on rewards values

* fix common tests

* do not reward availability anymore
This commit is contained in:
Robert Habermeier
2020-12-16 11:28:46 -06:00
committed by GitHub
parent 34e5812171
commit f4e930529b
8 changed files with 206 additions and 7 deletions
@@ -262,7 +262,7 @@ mod tests {
}, testing::{UintAuthorityId, TestXt}, Perbill, curve::PiecewiseLinear,
};
use primitives::v1::{
Balance, BlockNumber, Header, Signature, AuthorityDiscoveryId,
Balance, BlockNumber, Header, Signature, AuthorityDiscoveryId, ValidatorIndex,
};
use frame_system::limits;
use frame_support::{
@@ -472,8 +472,16 @@ mod tests {
impl configuration::Config for Test { }
pub struct TestRewardValidators;
impl inclusion::RewardValidators for TestRewardValidators {
fn reward_backing(_: impl IntoIterator<Item = ValidatorIndex>) { }
fn reward_bitfields(_: impl IntoIterator<Item = ValidatorIndex>) { }
}
impl inclusion::Config for Test {
type Event = ();
type RewardValidators = TestRewardValidators;
}
impl session_info::AuthorityDiscoveryConfig for Test {