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
33 const blockInterval = inflationBlockInterval.toNumber();33 const blockInterval = inflationBlockInterval.toNumber();
34 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {34 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
35 const currentBlock = head.number.toNumber();35 const currentBlock = head.number.toNumber();
36 if(currentBlock % blockInterval < blockInterval - 2) {36 if(currentBlock % blockInterval < blockInterval - (blockInterval / 5)) {
37 unsubscribe();37 unsubscribe();
38 resolve();38 resolve();
39 } else {39 } else {
modifiedpallets/inflation/Cargo.tomldiffbeforeafterboth
27 'sp-std/std',27 'sp-std/std',
28]28]
29try-runtime = ["frame-support/try-runtime"]29try-runtime = ["frame-support/try-runtime"]
30fast-inflation = []
3031
31[dependencies]32[dependencies]
32parity-scale-codec = { workspace = true }33parity-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
232preimage = []232preimage = []
233refungible = []233refungible = []
234session-test-timings = []234session-test-timings = []
235fast-inflation = []
235236
236################################################################################237################################################################################
237# local dependencies238# 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
224preimage = []224preimage = []
225refungible = []225refungible = []
226session-test-timings = []226session-test-timings = []
227fast-inflation = []
227228
228################################################################################229################################################################################
229# local dependencies230# local dependencies