git.delta.rocks / unique-network / refs/commits / 47f93e7908f3

difftreelog

feature(runtime): app promoi rate is changed

PraetorP2023-10-25parent: #32f66f7.patch.diff
in: master

4 files changed

modifiedjs-packages/tests/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth
--- a/js-packages/tests/sub/appPromotion/appPromotion.test.ts
+++ b/js-packages/tests/sub/appPromotion/appPromotion.test.ts
@@ -984,7 +984,7 @@
   const DAY = 7200n;
   const ACCURACY = 1_000_000_000n;
   // 5n / 10_000n = 0.05% p/day
-  const income = base + base * (ACCURACY * (calcPeriod * 5n) / (10_000n * DAY)) / ACCURACY ;
+  const income = base + base * (ACCURACY * (calcPeriod * 453_256n) / (1_000_000_000n * DAY)) / ACCURACY ;
 
   if(iter > 1) {
     return calculateIncome(income, iter - 1, calcPeriod);
modifiedpallets/collator-selection/src/mock.rsdiffbeforeafterboth
--- a/pallets/collator-selection/src/mock.rs
+++ b/pallets/collator-selection/src/mock.rs
@@ -208,7 +208,7 @@
 	pub const DefaultWeightToFeeCoefficient: u64 = 100_000;
 	pub const DefaultMinGasPrice: u64 = 100_000;
 	pub const MaxXcmAllowedLocations: u32 = 16;
-	pub AppPromotionDailyRate: Perbill = Perbill::from_rational(5u32, 10_000);
+	pub AppPromotionDailyRate: Perbill = Perbill::from_rational(453_256u64, 1_000_000_000u64);
 	pub const DayRelayBlocks: u32 = 1;
 	pub const LicenceBondIdentifier: [u8; 16] = *b"licenceidentifie";
 }
modifiedruntime/common/config/pallets/app_promotion.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use frame_support::{parameter_types, PalletId};17use frame_support::{parameter_types, PalletId};
18use sp_arithmetic::Perbill;
19use up_common::{18use up_common::{
20 constants::{DAYS, RELAY_DAYS, UNIQUE},19 constants::{DAYS, RELAY_DAYS, UNIQUE},
21 types::Balance,20 types::Balance,
22};21};
2322
23use super::AppPromotionDailyRate;
24use crate::{24use crate::{
25 runtime_common::config::pallets::{RelayChainBlockNumberProvider, TreasuryAccountId},25 runtime_common::config::pallets::{RelayChainBlockNumberProvider, TreasuryAccountId},
26 Balances, BlockNumber, EvmContractHelpers, Maintenance, Runtime, RuntimeEvent, Unique,26 Balances, BlockNumber, EvmContractHelpers, Maintenance, Runtime, RuntimeEvent, Unique,
32 pub const PendingInterval: BlockNumber = 7 * DAYS;32 pub const PendingInterval: BlockNumber = 7 * DAYS;
33 pub const Nominal: Balance = UNIQUE;33 pub const Nominal: Balance = UNIQUE;
34 pub const HoldAndFreezeIdentifier: [u8; 16] = *b"appstakeappstake";34 pub const HoldAndFreezeIdentifier: [u8; 16] = *b"appstakeappstake";
35 pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000);
36 pub MaintenanceMode: bool = Maintenance::is_enabled();35 pub MaintenanceMode: bool = Maintenance::is_enabled();
37}36}
3837
47 type RecalculationInterval = RecalculationInterval;46 type RecalculationInterval = RecalculationInterval;
48 type PendingInterval = PendingInterval;47 type PendingInterval = PendingInterval;
49 type Nominal = Nominal;48 type Nominal = Nominal;
50 type IntervalIncome = IntervalIncome;49 type IntervalIncome = AppPromotionDailyRate;
51 type RuntimeEvent = RuntimeEvent;50 type RuntimeEvent = RuntimeEvent;
52 type FreezeIdentifier = HoldAndFreezeIdentifier;51 type FreezeIdentifier = HoldAndFreezeIdentifier;
53 type IsMaintenanceModeEnabled = MaintenanceMode;52 type IsMaintenanceModeEnabled = MaintenanceMode;
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -151,7 +151,7 @@
 }
 
 parameter_types! {
-	pub AppPromotionDailyRate: Perbill = Perbill::from_rational(5u32, 10_000);
+	pub AppPromotionDailyRate: Perbill = Perbill::from_rational(453_256u64, 1_000_000_000u64);
 	pub const MaxCollators: u32 = MAX_COLLATORS;
 	pub const LicenseBond: Balance = GENESIS_LICENSE_BOND;