difftreelog
Fix inflation build
in: master
3 files changed
pallets/inflation/src/lib.rsdiffbeforeafterboth--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -3,23 +3,17 @@
// file 'LICENSE', which is part of this source code package.
//
-#![recursion_limit = "1024"]
+// #![recursion_limit = "1024"]
#![cfg_attr(not(feature = "std"), no_std)]
-#![allow(
- clippy::too_many_arguments,
- clippy::unnecessary_mut_passed,
- clippy::unused_unit
-)]
+#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
-#[cfg(test)]
-mod mock;
+
#[cfg(test)]
mod tests;
use frame_support::{
dispatch::{DispatchResult},
- ensure,
traits::{Currency, Get},
};
pub use pallet::*;
@@ -28,7 +22,7 @@
traits::{BlockNumberProvider}
};
-use std::convert::TryInto;
+use sp_std::convert::TryInto;
type BalanceOf<T> =
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
@@ -44,12 +38,6 @@
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
-
- #[pallet::error]
- pub enum Error<T> {
- /// Inflation has already been initialized
- AlreadyInitialized,
- }
#[pallet::config]
pub trait Config: frame_system::Config {
@@ -144,17 +132,17 @@
where <T as frame_system::Config>::BlockNumber: From<u32> {
ensure_root(origin)?;
- // Ensure inflation has not been yet initialized
+ // Start inflation if it has not been yet initialized
let next_inflation: T::BlockNumber = <NextInflationBlock<T>>::get();
- ensure!(next_inflation == 0u32.into(), Error::<T>::AlreadyInitialized);
-
- // Recalculate inflation. This can be backdated and will catch up.
- Self::recalculate_inflation(inflation_start_relay_block);
- let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0);
- <NextInflationBlock<T>>::set(inflation_start_relay_block + block_interval.into());
+ if next_inflation == 0u32.into() {
+ // Recalculate inflation. This can be backdated and will catch up.
+ Self::recalculate_inflation(inflation_start_relay_block);
+ let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0);
+ <NextInflationBlock<T>>::set(inflation_start_relay_block + block_interval.into());
- // First time deposit - create Treasury account so that we can call deposit_into_existing everywhere else
- T::Currency::deposit_creating(&T::TreasuryAccountId::get(), <BlockInflation<T>>::get());
+ // First time deposit - create Treasury account so that we can call deposit_into_existing everywhere else
+ T::Currency::deposit_creating(&T::TreasuryAccountId::get(), <BlockInflation<T>>::get());
+ }
Ok(())
}
runtime/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.12'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-fungible/runtime-benchmarks',33 'pallet-refungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',36 'pallet-inflation/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',40]41std = [42 'codec/std',43 'cumulus-pallet-aura-ext/std',44 'cumulus-pallet-parachain-system/std',45 'cumulus-pallet-xcm/std',46 'cumulus-pallet-xcmp-queue/std',47 'cumulus-primitives-core/std',48 'cumulus-primitives-utility/std',49 'frame-executive/std',50 'frame-support/std',51 'frame-system/std',52 'frame-system-rpc-runtime-api/std',53 'pallet-aura/std',54 'pallet-balances/std',55 # 'pallet-contracts/std',56 # 'pallet-contracts-primitives/std',57 # 'pallet-contracts-rpc-runtime-api/std',58 # 'pallet-contract-helpers/std',59 'pallet-randomness-collective-flip/std',60 'pallet-sudo/std',61 'pallet-timestamp/std',62 'pallet-transaction-payment/std',63 'pallet-transaction-payment-rpc-runtime-api/std',64 'pallet-treasury/std',65 # 'pallet-vesting/std',66 'pallet-evm/std',67 'pallet-evm-migration/std',68 'pallet-evm-contract-helpers/std',69 'pallet-evm-transaction-payment/std',70 'pallet-evm-coder-substrate/std',71 'pallet-ethereum/std',72 'fp-rpc/std',73 'up-rpc/std',74 'up-evm-mapping/std',75 'fp-self-contained/std',76 'parachain-info/std',77 'serde',78 'pallet-inflation/std',79 'pallet-common/std',80 'pallet-fungible/std',81 'pallet-refungible/std',82 'pallet-nonfungible/std',83 'pallet-unique/std',84 'pallet-unq-scheduler/std',85 'pallet-charge-transaction/std',86 'up-data-structs/std',87 'sp-api/std',88 'sp-block-builder/std',89 "sp-consensus-aura/std",90 'sp-core/std',91 'sp-inherents/std',92 'sp-io/std',93 'sp-offchain/std',94 'sp-runtime/std',95 'sp-session/std',96 'sp-std/std',97 'sp-transaction-pool/std',98 'sp-version/std',99 'xcm/std',100 'xcm-builder/std',101 'xcm-executor/std',102103 "orml-vesting/std",104]105limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']106107################################################################################108# Substrate Dependencies109110[dependencies.codec]111default-features = false112features = ['derive']113package = 'parity-scale-codec'114version = '2.3.0'115116[dependencies.frame-benchmarking]117default-features = false118git = 'https://github.com/paritytech/substrate.git'119optional = true120branch = 'polkadot-v0.9.12'121122[dependencies.frame-executive]123default-features = false124git = 'https://github.com/paritytech/substrate.git'125branch = 'polkadot-v0.9.12'126127[dependencies.frame-support]128default-features = false129git = 'https://github.com/paritytech/substrate.git'130branch = 'polkadot-v0.9.12'131132[dependencies.frame-system]133default-features = false134git = 'https://github.com/paritytech/substrate.git'135branch = 'polkadot-v0.9.12'136137[dependencies.frame-system-benchmarking]138default-features = false139git = 'https://github.com/paritytech/substrate.git'140optional = true141branch = 'polkadot-v0.9.12'142143[dependencies.frame-system-rpc-runtime-api]144default-features = false145git = 'https://github.com/paritytech/substrate.git'146branch = 'polkadot-v0.9.12'147148[dependencies.hex-literal]149optional = true150version = '0.3.3'151152[dependencies.serde]153default-features = false154features = ['derive']155optional = true156version = '1.0.130'157158[dependencies.pallet-aura]159default-features = false160git = 'https://github.com/paritytech/substrate.git'161branch = 'polkadot-v0.9.12'162163[dependencies.pallet-balances]164default-features = false165git = 'https://github.com/paritytech/substrate.git'166branch = 'polkadot-v0.9.12'167168# Contracts specific packages169# [dependencies.pallet-contracts]170# git = 'https://github.com/paritytech/substrate.git'171# default-features = false172# branch = 'polkadot-v0.9.12'173# version = '4.0.0-dev'174175# [dependencies.pallet-contracts-primitives]176# git = 'https://github.com/paritytech/substrate.git'177# default-features = false178# branch = 'polkadot-v0.9.12'179# version = '4.0.0-dev'180181# [dependencies.pallet-contracts-rpc-runtime-api]182# git = 'https://github.com/paritytech/substrate.git'183# default-features = false184# branch = 'polkadot-v0.9.12'185# version = '4.0.0-dev'186187[dependencies.pallet-randomness-collective-flip]188default-features = false189git = 'https://github.com/paritytech/substrate.git'190branch = 'polkadot-v0.9.12'191192[dependencies.pallet-sudo]193default-features = false194git = 'https://github.com/paritytech/substrate.git'195branch = 'polkadot-v0.9.12'196197[dependencies.pallet-timestamp]198default-features = false199git = 'https://github.com/paritytech/substrate.git'200branch = 'polkadot-v0.9.12'201202[dependencies.pallet-transaction-payment]203default-features = false204git = 'https://github.com/paritytech/substrate.git'205branch = 'polkadot-v0.9.12'206207[dependencies.pallet-transaction-payment-rpc-runtime-api]208default-features = false209git = 'https://github.com/paritytech/substrate.git'210branch = 'polkadot-v0.9.12'211212[dependencies.pallet-treasury]213default-features = false214git = 'https://github.com/paritytech/substrate.git'215branch = 'polkadot-v0.9.12'216217# [dependencies.pallet-vesting]218# default-features = false219# git = 'https://github.com/paritytech/substrate.git'220# branch = 'polkadot-v0.9.12'221222[dependencies.sp-arithmetic]223default-features = false224git = 'https://github.com/paritytech/substrate.git'225branch = 'polkadot-v0.9.12'226227[dependencies.sp-api]228default-features = false229git = 'https://github.com/paritytech/substrate.git'230branch = 'polkadot-v0.9.12'231232[dependencies.sp-block-builder]233default-features = false234git = 'https://github.com/paritytech/substrate.git'235branch = 'polkadot-v0.9.12'236237[dependencies.sp-core]238default-features = false239git = 'https://github.com/paritytech/substrate.git'240branch = 'polkadot-v0.9.12'241242[dependencies.sp-consensus-aura]243default-features = false244git = 'https://github.com/paritytech/substrate.git'245branch = 'polkadot-v0.9.12'246247[dependencies.sp-inherents]248default-features = false249git = 'https://github.com/paritytech/substrate.git'250branch = 'polkadot-v0.9.12'251252[dependencies.sp-io]253default-features = false254git = 'https://github.com/paritytech/substrate.git'255branch = 'polkadot-v0.9.12'256257[dependencies.sp-offchain]258default-features = false259git = 'https://github.com/paritytech/substrate.git'260branch = 'polkadot-v0.9.12'261262[dependencies.sp-runtime]263default-features = false264git = 'https://github.com/paritytech/substrate.git'265branch = 'polkadot-v0.9.12'266267[dependencies.sp-session]268default-features = false269git = 'https://github.com/paritytech/substrate.git'270branch = 'polkadot-v0.9.12'271272[dependencies.sp-std]273default-features = false274git = 'https://github.com/paritytech/substrate.git'275branch = 'polkadot-v0.9.12'276277[dependencies.sp-transaction-pool]278default-features = false279git = 'https://github.com/paritytech/substrate.git'280branch = 'polkadot-v0.9.12'281282[dependencies.sp-version]283default-features = false284git = 'https://github.com/paritytech/substrate.git'285branch = 'polkadot-v0.9.12'286287[dependencies.smallvec]288version = '1.6.1'289290################################################################################291# Cumulus dependencies292293[dependencies.parachain-info]294default-features = false295git = 'https://github.com/paritytech/cumulus.git'296branch = 'polkadot-v0.9.12'297298[dependencies.cumulus-pallet-aura-ext]299git = 'https://github.com/paritytech/cumulus.git'300branch = 'polkadot-v0.9.12'301default-features = false302303[dependencies.cumulus-pallet-parachain-system]304git = 'https://github.com/paritytech/cumulus.git'305branch = 'polkadot-v0.9.12'306default-features = false307308[dependencies.cumulus-primitives-core]309git = 'https://github.com/paritytech/cumulus.git'310branch = 'polkadot-v0.9.12'311default-features = false312313[dependencies.cumulus-pallet-xcm]314git = 'https://github.com/paritytech/cumulus.git'315branch = 'polkadot-v0.9.12'316default-features = false317318[dependencies.cumulus-pallet-dmp-queue]319git = 'https://github.com/paritytech/cumulus.git'320branch = 'polkadot-v0.9.12'321default-features = false322323[dependencies.cumulus-pallet-xcmp-queue]324git = 'https://github.com/paritytech/cumulus.git'325branch = 'polkadot-v0.9.12'326default-features = false327328[dependencies.cumulus-primitives-utility]329git = 'https://github.com/paritytech/cumulus.git'330branch = 'polkadot-v0.9.12'331default-features = false332333[dependencies.cumulus-primitives-timestamp]334git = 'https://github.com/paritytech/cumulus.git'335branch = 'polkadot-v0.9.12'336default-features = false337338################################################################################339# Polkadot dependencies340341[dependencies.polkadot-parachain]342git = 'https://github.com/paritytech/polkadot'343branch = 'release-v0.9.12'344default-features = false345346[dependencies.xcm]347git = 'https://github.com/paritytech/polkadot'348branch = 'release-v0.9.12'349default-features = false350351[dependencies.xcm-builder]352git = 'https://github.com/paritytech/polkadot'353branch = 'release-v0.9.12'354default-features = false355356[dependencies.xcm-executor]357git = 'https://github.com/paritytech/polkadot'358branch = 'release-v0.9.12'359default-features = false360361[dependencies.pallet-xcm]362git = 'https://github.com/paritytech/polkadot'363branch = 'release-v0.9.12'364default-features = false365366[dependencies.orml-vesting]367git = 'https://github.com/UniqueNetwork/open-runtime-module-library'368version = "0.4.1-dev" 369default-features = false370371################################################################################372# local dependencies373374[dependencies]375scale-info = { version = "1.0.0", default-features = false, features = [376 "derive",377] }378derivative = "2.2.0"379pallet-unique = { path = '../pallets/unique', default-features = false }380up-rpc = { path = "../primitives/rpc", default-features = false }381up-evm-mapping = { path = "../primitives/evm-mapping", default-features = false }382pallet-inflation = { path = '../pallets/inflation' }383up-data-structs = { path = '../primitives/data-structs', default-features = false }384pallet-common = { default-features = false, path = "../pallets/common" }385pallet-fungible = { default-features = false, path = "../pallets/fungible" }386pallet-refungible = { default-features = false, path = "../pallets/refungible" }387pallet-nonfungible = { default-features = false, path = "../pallets/nonfungible" }388pallet-unq-scheduler = { path = '../pallets/scheduler', default-features = false }389# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }390pallet-charge-transaction = { git = "https://github.com/UniqueNetwork/pallet-sponsoring", package = "pallet-template-transaction-payment", default-features = false, version = '3.0.0' }391pallet-evm-migration = { path = '../pallets/evm-migration', default-features = false }392pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }393pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }394pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }395396pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }397pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }398fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }399fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }400401################################################################################402# Build Dependencies403404[build-dependencies.substrate-wasm-builder]405git = 'https://github.com/paritytech/substrate.git'406branch = 'polkadot-v0.9.12'1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.12'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-fungible/runtime-benchmarks',33 'pallet-refungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',36 'pallet-inflation/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',40]41std = [42 'codec/std',43 'cumulus-pallet-aura-ext/std',44 'cumulus-pallet-parachain-system/std',45 'cumulus-pallet-xcm/std',46 'cumulus-pallet-xcmp-queue/std',47 'cumulus-primitives-core/std',48 'cumulus-primitives-utility/std',49 'frame-executive/std',50 'frame-support/std',51 'frame-system/std',52 'frame-system-rpc-runtime-api/std',53 'pallet-aura/std',54 'pallet-balances/std',55 # 'pallet-contracts/std',56 # 'pallet-contracts-primitives/std',57 # 'pallet-contracts-rpc-runtime-api/std',58 # 'pallet-contract-helpers/std',59 'pallet-randomness-collective-flip/std',60 'pallet-sudo/std',61 'pallet-timestamp/std',62 'pallet-transaction-payment/std',63 'pallet-transaction-payment-rpc-runtime-api/std',64 'pallet-treasury/std',65 # 'pallet-vesting/std',66 'pallet-evm/std',67 'pallet-evm-migration/std',68 'pallet-evm-contract-helpers/std',69 'pallet-evm-transaction-payment/std',70 'pallet-evm-coder-substrate/std',71 'pallet-ethereum/std',72 'fp-rpc/std',73 'up-rpc/std',74 'up-evm-mapping/std',75 'fp-self-contained/std',76 'parachain-info/std',77 'serde',78 'pallet-inflation/std',79 'pallet-common/std',80 'pallet-fungible/std',81 'pallet-refungible/std',82 'pallet-nonfungible/std',83 'pallet-unique/std',84 'pallet-unq-scheduler/std',85 'pallet-charge-transaction/std',86 'up-data-structs/std',87 'sp-api/std',88 'sp-block-builder/std',89 "sp-consensus-aura/std",90 'sp-core/std',91 'sp-inherents/std',92 'sp-io/std',93 'sp-offchain/std',94 'sp-runtime/std',95 'sp-session/std',96 'sp-std/std',97 'sp-transaction-pool/std',98 'sp-version/std',99 'xcm/std',100 'xcm-builder/std',101 'xcm-executor/std',102103 "orml-vesting/std",104]105limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']106107################################################################################108# Substrate Dependencies109110[dependencies.codec]111default-features = false112features = ['derive']113package = 'parity-scale-codec'114version = '2.3.0'115116[dependencies.frame-benchmarking]117default-features = false118git = 'https://github.com/paritytech/substrate.git'119optional = true120branch = 'polkadot-v0.9.12'121122[dependencies.frame-executive]123default-features = false124git = 'https://github.com/paritytech/substrate.git'125branch = 'polkadot-v0.9.12'126127[dependencies.frame-support]128default-features = false129git = 'https://github.com/paritytech/substrate.git'130branch = 'polkadot-v0.9.12'131132[dependencies.frame-system]133default-features = false134git = 'https://github.com/paritytech/substrate.git'135branch = 'polkadot-v0.9.12'136137[dependencies.frame-system-benchmarking]138default-features = false139git = 'https://github.com/paritytech/substrate.git'140optional = true141branch = 'polkadot-v0.9.12'142143[dependencies.frame-system-rpc-runtime-api]144default-features = false145git = 'https://github.com/paritytech/substrate.git'146branch = 'polkadot-v0.9.12'147148[dependencies.hex-literal]149optional = true150version = '0.3.3'151152[dependencies.serde]153default-features = false154features = ['derive']155optional = true156version = '1.0.130'157158[dependencies.pallet-aura]159default-features = false160git = 'https://github.com/paritytech/substrate.git'161branch = 'polkadot-v0.9.12'162163[dependencies.pallet-balances]164default-features = false165git = 'https://github.com/paritytech/substrate.git'166branch = 'polkadot-v0.9.12'167168# Contracts specific packages169# [dependencies.pallet-contracts]170# git = 'https://github.com/paritytech/substrate.git'171# default-features = false172# branch = 'polkadot-v0.9.12'173# version = '4.0.0-dev'174175# [dependencies.pallet-contracts-primitives]176# git = 'https://github.com/paritytech/substrate.git'177# default-features = false178# branch = 'polkadot-v0.9.12'179# version = '4.0.0-dev'180181# [dependencies.pallet-contracts-rpc-runtime-api]182# git = 'https://github.com/paritytech/substrate.git'183# default-features = false184# branch = 'polkadot-v0.9.12'185# version = '4.0.0-dev'186187[dependencies.pallet-randomness-collective-flip]188default-features = false189git = 'https://github.com/paritytech/substrate.git'190branch = 'polkadot-v0.9.12'191192[dependencies.pallet-sudo]193default-features = false194git = 'https://github.com/paritytech/substrate.git'195branch = 'polkadot-v0.9.12'196197[dependencies.pallet-timestamp]198default-features = false199git = 'https://github.com/paritytech/substrate.git'200branch = 'polkadot-v0.9.12'201202[dependencies.pallet-transaction-payment]203default-features = false204git = 'https://github.com/paritytech/substrate.git'205branch = 'polkadot-v0.9.12'206207[dependencies.pallet-transaction-payment-rpc-runtime-api]208default-features = false209git = 'https://github.com/paritytech/substrate.git'210branch = 'polkadot-v0.9.12'211212[dependencies.pallet-treasury]213default-features = false214git = 'https://github.com/paritytech/substrate.git'215branch = 'polkadot-v0.9.12'216217# [dependencies.pallet-vesting]218# default-features = false219# git = 'https://github.com/paritytech/substrate.git'220# branch = 'polkadot-v0.9.12'221222[dependencies.sp-arithmetic]223default-features = false224git = 'https://github.com/paritytech/substrate.git'225branch = 'polkadot-v0.9.12'226227[dependencies.sp-api]228default-features = false229git = 'https://github.com/paritytech/substrate.git'230branch = 'polkadot-v0.9.12'231232[dependencies.sp-block-builder]233default-features = false234git = 'https://github.com/paritytech/substrate.git'235branch = 'polkadot-v0.9.12'236237[dependencies.sp-core]238default-features = false239git = 'https://github.com/paritytech/substrate.git'240branch = 'polkadot-v0.9.12'241242[dependencies.sp-consensus-aura]243default-features = false244git = 'https://github.com/paritytech/substrate.git'245branch = 'polkadot-v0.9.12'246247[dependencies.sp-inherents]248default-features = false249git = 'https://github.com/paritytech/substrate.git'250branch = 'polkadot-v0.9.12'251252[dependencies.sp-io]253default-features = false254git = 'https://github.com/paritytech/substrate.git'255branch = 'polkadot-v0.9.12'256257[dependencies.sp-offchain]258default-features = false259git = 'https://github.com/paritytech/substrate.git'260branch = 'polkadot-v0.9.12'261262[dependencies.sp-runtime]263default-features = false264git = 'https://github.com/paritytech/substrate.git'265branch = 'polkadot-v0.9.12'266267[dependencies.sp-session]268default-features = false269git = 'https://github.com/paritytech/substrate.git'270branch = 'polkadot-v0.9.12'271272[dependencies.sp-std]273default-features = false274git = 'https://github.com/paritytech/substrate.git'275branch = 'polkadot-v0.9.12'276277[dependencies.sp-transaction-pool]278default-features = false279git = 'https://github.com/paritytech/substrate.git'280branch = 'polkadot-v0.9.12'281282[dependencies.sp-version]283default-features = false284git = 'https://github.com/paritytech/substrate.git'285branch = 'polkadot-v0.9.12'286287[dependencies.smallvec]288version = '1.6.1'289290################################################################################291# Cumulus dependencies292293[dependencies.parachain-info]294default-features = false295git = 'https://github.com/paritytech/cumulus.git'296branch = 'polkadot-v0.9.12'297298[dependencies.cumulus-pallet-aura-ext]299git = 'https://github.com/paritytech/cumulus.git'300branch = 'polkadot-v0.9.12'301default-features = false302303[dependencies.cumulus-pallet-parachain-system]304git = 'https://github.com/paritytech/cumulus.git'305branch = 'polkadot-v0.9.12'306default-features = false307308[dependencies.cumulus-primitives-core]309git = 'https://github.com/paritytech/cumulus.git'310branch = 'polkadot-v0.9.12'311default-features = false312313[dependencies.cumulus-pallet-xcm]314git = 'https://github.com/paritytech/cumulus.git'315branch = 'polkadot-v0.9.12'316default-features = false317318[dependencies.cumulus-pallet-dmp-queue]319git = 'https://github.com/paritytech/cumulus.git'320branch = 'polkadot-v0.9.12'321default-features = false322323[dependencies.cumulus-pallet-xcmp-queue]324git = 'https://github.com/paritytech/cumulus.git'325branch = 'polkadot-v0.9.12'326default-features = false327328[dependencies.cumulus-primitives-utility]329git = 'https://github.com/paritytech/cumulus.git'330branch = 'polkadot-v0.9.12'331default-features = false332333[dependencies.cumulus-primitives-timestamp]334git = 'https://github.com/paritytech/cumulus.git'335branch = 'polkadot-v0.9.12'336default-features = false337338################################################################################339# Polkadot dependencies340341[dependencies.polkadot-parachain]342git = 'https://github.com/paritytech/polkadot'343branch = 'release-v0.9.12'344default-features = false345346[dependencies.xcm]347git = 'https://github.com/paritytech/polkadot'348branch = 'release-v0.9.12'349default-features = false350351[dependencies.xcm-builder]352git = 'https://github.com/paritytech/polkadot'353branch = 'release-v0.9.12'354default-features = false355356[dependencies.xcm-executor]357git = 'https://github.com/paritytech/polkadot'358branch = 'release-v0.9.12'359default-features = false360361[dependencies.pallet-xcm]362git = 'https://github.com/paritytech/polkadot'363branch = 'release-v0.9.12'364default-features = false365366[dependencies.orml-vesting]367git = 'https://github.com/UniqueNetwork/open-runtime-module-library'368version = "0.4.1-dev" 369default-features = false370371################################################################################372# local dependencies373374[dependencies]375scale-info = { version = "1.0.0", default-features = false, features = [376 "derive",377] }378derivative = "2.2.0"379pallet-unique = { path = '../pallets/unique', default-features = false }380up-rpc = { path = "../primitives/rpc", default-features = false }381up-evm-mapping = { path = "../primitives/evm-mapping", default-features = false }382pallet-inflation = { path = '../pallets/inflation', default-features = false }383up-data-structs = { path = '../primitives/data-structs', default-features = false }384pallet-common = { default-features = false, path = "../pallets/common" }385pallet-fungible = { default-features = false, path = "../pallets/fungible" }386pallet-refungible = { default-features = false, path = "../pallets/refungible" }387pallet-nonfungible = { default-features = false, path = "../pallets/nonfungible" }388pallet-unq-scheduler = { path = '../pallets/scheduler', default-features = false }389# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }390pallet-charge-transaction = { git = "https://github.com/UniqueNetwork/pallet-sponsoring", package = "pallet-template-transaction-payment", default-features = false, version = '3.0.0' }391pallet-evm-migration = { path = '../pallets/evm-migration', default-features = false }392pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }393pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }394pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }395396pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }397pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }398fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }399fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.12-weights" }400401################################################################################402# Build Dependencies403404[build-dependencies.substrate-wasm-builder]405git = 'https://github.com/paritytech/substrate.git'406branch = 'polkadot-v0.9.12'tests/src/inflation.test.tsdiffbeforeafterboth--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -5,7 +5,8 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import {default as usingApi} from './substrate/substrate-api';
+import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
+import privateKey from './substrate/privateKey';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -14,8 +15,15 @@
it('First year inflation is 10%', async () => {
await usingApi(async (api) => {
- // Start inflation on relay block 1
- await api.tx.inflation.start_inflation(1);
+ // Make sure non-sudo can't start inflation
+ const tx = api.tx.inflation.startInflation(1);
+ const bob = privateKey('//Bob');
+ await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
+
+ // Start inflation on relay block 1 (Alice is sudo)
+ const alice = privateKey('//Alice');
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ await submitTransactionAsync(alice, sudoTx);
const blockInterval = (api.consts.inflation.inflationBlockInterval).toBigInt();
const totalIssuanceStart = (await api.query.inflation.startingYearTotalIssuance()).toBigInt();