Skip to content

Commit

Permalink
Set payout fraction to 40% (#284)
Browse files Browse the repository at this point in the history
* Set payout fraction to 40%

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>
  • Loading branch information
AurevoirXavier authored Feb 16, 2023
1 parent 59e08ee commit a3403ce
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pallet/staking/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl darwinia_staking::Stake for KtonStaking {
}
}
frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}
impl darwinia_staking::Config for Runtime {
type Deposit = Deposit;
Expand Down
24 changes: 12 additions & 12 deletions pallet/staking/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,16 @@ fn payout_should_work() {
let session_duration = Duration::new(6 * 60 * 60, 0).as_millis();
Staking::payout(session_duration, Staking::elapsed_time());
let rewards = [
683_059_435_062_369_982_561_u128,
1_275_044_256_196_592_252_422,
1_775_954_509_850_707_836_449,
2_185_790_171_434_577_367_478,
2_504_551_227_287_012_308_196,
2_049_178_272_400_257_458_130,
1_457_193_451_266_035_188_269,
956_283_197_611_919_604_242,
546_447_536_028_050_073_213,
227_686_480_175_615_132_495,
1_366_118_870_124_739_965_121_u128,
2_550_088_512_393_184_504_844,
3_551_909_019_701_415_672_898,
4_371_580_342_869_154_734_956,
5_009_102_454_574_024_616_391,
4_098_356_544_800_514_916_261,
2_914_386_902_532_070_376_538,
1_912_566_395_223_839_208_483,
1_092_895_072_056_100_146_426,
455_372_960_351_230_264_991,
];
(1..=10)
.zip(rewards.iter())
Expand All @@ -566,8 +566,8 @@ fn payout_should_work() {
)
.unwrap(),
rewards.iter().sum::<Balance>(),
// Error rate 0.02 RING
2 * UNIT / 100
// Error rate 0.1 RING.
UNIT / 10
);
});
}
2 changes: 1 addition & 1 deletion precompile/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl pallet_evm::Config for TestRuntime {
}

frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}

pub enum RingStaking {}
Expand Down
2 changes: 1 addition & 1 deletion runtime/crab/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl darwinia_staking::Stake for KtonStaking {
}

frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}

impl darwinia_staking::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion runtime/darwinia/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl darwinia_staking::Stake for KtonStaking {
}

frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}

impl darwinia_staking::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangolin/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl darwinia_staking::Stake for KtonStaking {
}

frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}

impl darwinia_staking::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangoro/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl darwinia_staking::Stake for KtonStaking {
}

frame_support::parameter_types! {
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(20);
pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40);
}

impl darwinia_staking::Config for Runtime {
Expand Down

0 comments on commit a3403ce

Please sign in to comment.