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
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -101,8 +101,14 @@
 	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;
 }
 
+// every time per how many blocks inflation is applied
+#[cfg(feature = "fast-inflation")]
+parameter_types! {
+	pub const InflationBlockInterval: BlockNumber = 10;
+}
+#[cfg(not(feature = "fast-inflation"))]
 parameter_types! {
-	pub const InflationBlockInterval: BlockNumber = 10; // every time per how many blocks inflation is applied
+	pub const InflationBlockInterval: BlockNumber = 100;
 }
 
 /// Pallet-inflation needs block number in on_initialize, where there is no `validation_data` exists yet
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
221preimage = []221preimage = []
222refungible = []222refungible = []
223session-test-timings = []223session-test-timings = []
224fast-inflation = []
224225
225################################################################################226################################################################################
226# local dependencies227# 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