git.delta.rocks / unique-network / refs/commits / 8b49ab609aee

difftreelog

feat add fast-inflation flag

Grigoriy Simonov2023-11-15parent: #83c9d63.patch.diff
in: master

6 files changed

modifiedjs-packages/tests/creditFeesToTreasury.seqtest.tsdiffbeforeafterboth
--- a/js-packages/tests/creditFeesToTreasury.seqtest.ts
+++ b/js-packages/tests/creditFeesToTreasury.seqtest.ts
@@ -33,7 +33,7 @@
     const blockInterval = inflationBlockInterval.toNumber();
     const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
       const currentBlock = head.number.toNumber();
-      if(currentBlock % blockInterval < blockInterval - 2) {
+      if(currentBlock % blockInterval < blockInterval - (blockInterval / 5)) {
         unsubscribe();
         resolve();
       } else {
modifiedpallets/inflation/Cargo.tomldiffbeforeafterboth
--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -27,6 +27,7 @@
 	'sp-std/std',
 ]
 try-runtime = ["frame-support/try-runtime"]
+fast-inflation = []
 
 [dependencies]
 parity-scale-codec = { workspace = true }
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
101 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;101 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;
102}102}
103103
104// every time per how many blocks inflation is applied
105#[cfg(feature = "fast-inflation")]
104parameter_types! {106parameter_types! {
105 pub const InflationBlockInterval: BlockNumber = 10; // every time per how many blocks inflation is applied107 pub const InflationBlockInterval: BlockNumber = 10;
106}108}
109#[cfg(not(feature = "fast-inflation"))]
110parameter_types! {
111 pub const InflationBlockInterval: BlockNumber = 100;
112}
107113
108/// Pallet-inflation needs block number in on_initialize, where there is no `validation_data` exists yet114/// Pallet-inflation needs block number in on_initialize, where there is no `validation_data` exists yet
109pub struct OnInitializeBlockNumberProvider;115pub struct OnInitializeBlockNumberProvider;
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -232,6 +232,7 @@
 preimage = []
 refungible = []
 session-test-timings = []
+fast-inflation = []
 
 ################################################################################
 # local dependencies
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -221,6 +221,7 @@
 preimage = []
 refungible = []
 session-test-timings = []
+fast-inflation = []
 
 ################################################################################
 # local dependencies
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -224,6 +224,7 @@
 preimage = []
 refungible = []
 session-test-timings = []
+fast-inflation = []
 
 ################################################################################
 # local dependencies