From a3403ceffa9995fa4e33708f29feb5179f00ac47 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Thu, 16 Feb 2023 10:57:19 +0800 Subject: [PATCH] Set payout fraction to 40% (#284) * Set payout fraction to 40% * Format Signed-off-by: Xavier Lau --------- Signed-off-by: Xavier Lau --- pallet/staking/tests/mock.rs | 2 +- pallet/staking/tests/tests.rs | 24 ++++++++++++------------ precompile/staking/src/mock.rs | 2 +- runtime/crab/src/pallets/staking.rs | 2 +- runtime/darwinia/src/pallets/staking.rs | 2 +- runtime/pangolin/src/pallets/staking.rs | 2 +- runtime/pangoro/src/pallets/staking.rs | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pallet/staking/tests/mock.rs b/pallet/staking/tests/mock.rs index b7b0bae2c..e1574aa3d 100644 --- a/pallet/staking/tests/mock.rs +++ b/pallet/staking/tests/mock.rs @@ -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; diff --git a/pallet/staking/tests/tests.rs b/pallet/staking/tests/tests.rs index 048eb10d0..209282298 100644 --- a/pallet/staking/tests/tests.rs +++ b/pallet/staking/tests/tests.rs @@ -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()) @@ -566,8 +566,8 @@ fn payout_should_work() { ) .unwrap(), rewards.iter().sum::(), - // Error rate 0.02 RING - 2 * UNIT / 100 + // Error rate 0.1 RING. + UNIT / 10 ); }); } diff --git a/precompile/staking/src/mock.rs b/precompile/staking/src/mock.rs index 8062b4a3c..b7ef3374e 100644 --- a/precompile/staking/src/mock.rs +++ b/precompile/staking/src/mock.rs @@ -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 {} diff --git a/runtime/crab/src/pallets/staking.rs b/runtime/crab/src/pallets/staking.rs index 2abda17e3..f7fc924b5 100644 --- a/runtime/crab/src/pallets/staking.rs +++ b/runtime/crab/src/pallets/staking.rs @@ -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 { diff --git a/runtime/darwinia/src/pallets/staking.rs b/runtime/darwinia/src/pallets/staking.rs index 7d3aa2d50..4ade2ee4a 100644 --- a/runtime/darwinia/src/pallets/staking.rs +++ b/runtime/darwinia/src/pallets/staking.rs @@ -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 { diff --git a/runtime/pangolin/src/pallets/staking.rs b/runtime/pangolin/src/pallets/staking.rs index 0c76fe413..9760508e9 100644 --- a/runtime/pangolin/src/pallets/staking.rs +++ b/runtime/pangolin/src/pallets/staking.rs @@ -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 { diff --git a/runtime/pangoro/src/pallets/staking.rs b/runtime/pangoro/src/pallets/staking.rs index 50e17ac96..a3ead0738 100644 --- a/runtime/pangoro/src/pallets/staking.rs +++ b/runtime/pangoro/src/pallets/staking.rs @@ -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 {