difftreelog
feat add fast-inflation flag
in: master
6 files changed
js-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 {
pallets/inflation/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6description = 'Unique Inflation Pallet'7edition = '2021'8homepage = 'https://unique.network'9license = 'GPLv3'10name = 'pallet-inflation'11repository = 'https://github.com/UniqueNetwork/unique-chain'12version = "0.1.1"1314[package.metadata.docs.rs]15targets = ['x86_64-unknown-linux-gnu']1617[features]18default = ['std']19runtime-benchmarks = ['frame-benchmarking']20std = [21 'frame-benchmarking/std',22 'frame-support/std',23 'frame-system/std',24 'pallet-balances/std',25 'parity-scale-codec/std',26 'sp-runtime/std',27 'sp-std/std',28]29try-runtime = ["frame-support/try-runtime"]3031[dependencies]32parity-scale-codec = { workspace = true }33scale-info = { workspace = true }3435frame-benchmarking = { workspace = true, optional = true }36frame-support = { workspace = true }37frame-system = { workspace = true }38pallet-balances = { features = ["insecure_zero_ed"], workspace = true }39sp-core = { workspace = true }40sp-io = { workspace = true }41sp-runtime = { workspace = true }42sp-std = { workspace = true }1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6description = 'Unique Inflation Pallet'7edition = '2021'8homepage = 'https://unique.network'9license = 'GPLv3'10name = 'pallet-inflation'11repository = 'https://github.com/UniqueNetwork/unique-chain'12version = "0.1.1"1314[package.metadata.docs.rs]15targets = ['x86_64-unknown-linux-gnu']1617[features]18default = ['std']19runtime-benchmarks = ['frame-benchmarking']20std = [21 'frame-benchmarking/std',22 'frame-support/std',23 'frame-system/std',24 'pallet-balances/std',25 'parity-scale-codec/std',26 'sp-runtime/std',27 'sp-std/std',28]29try-runtime = ["frame-support/try-runtime"]30fast-inflation = []3132[dependencies]33parity-scale-codec = { workspace = true }34scale-info = { workspace = true }3536frame-benchmarking = { workspace = true, optional = true }37frame-support = { workspace = true }38frame-system = { workspace = true }39pallet-balances = { features = ["insecure_zero_ed"], workspace = true }40sp-core = { workspace = true }41sp-io = { workspace = true }42sp-runtime = { workspace = true }43sp-std = { workspace = true }runtime/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
runtime/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
runtime/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
runtime/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