difftreelog
cargo fmt
in: master
18 files changed
common-types/src/lib.rsdiffbeforeafterboth--- a/common-types/src/lib.rs
+++ b/common-types/src/lib.rs
@@ -17,8 +17,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
use sp_runtime::{
- generic,
- traits::{Verify, IdentifyAccount}, MultiSignature,
+ generic,
+ traits::{Verify, IdentifyAccount},
+ MultiSignature,
};
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
@@ -26,33 +27,29 @@
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
/// to even the core data structures.
pub mod opaque {
- pub use sp_runtime::{
- generic,
- traits::BlakeTwo256,
- OpaqueExtrinsic as UncheckedExtrinsic
- };
+ pub use sp_runtime::{generic, traits::BlakeTwo256, OpaqueExtrinsic as UncheckedExtrinsic};
pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId};
- /// Opaque block header type.
- pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
+ /// Opaque block header type.
+ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
- /// Opaque block type.
- pub type Block = generic::Block<Header, UncheckedExtrinsic>;
+ /// Opaque block type.
+ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
- pub trait RuntimeInstance {
- type CrossAccountId: pallet_evm::account::CrossAccountId<sp_runtime::AccountId32>
- + Send
- + Sync
- + 'static;
+ pub trait RuntimeInstance {
+ type CrossAccountId: pallet_evm::account::CrossAccountId<sp_runtime::AccountId32>
+ + Send
+ + Sync
+ + 'static;
- type TransactionConverter: fp_rpc::ConvertTransaction<UncheckedExtrinsic>
- + Send
- + Sync
- + 'static;
+ type TransactionConverter: fp_rpc::ConvertTransaction<UncheckedExtrinsic>
+ + Send
+ + Sync
+ + 'static;
- fn get_transaction_converter() -> Self::TransactionConverter;
- }
+ fn get_transaction_converter() -> Self::TransactionConverter;
+ }
}
pub type SessionHandlers = ();
node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -40,9 +40,7 @@
use sc_service::TransactionPool;
use std::{collections::BTreeMap, sync::Arc};
-use common_types::opaque::{
- Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance,
-};
+use common_types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance};
// RMRK
use up_data_structs::{
runtime/common/config/ethereum.rsdiffbeforeafterboth--- a/runtime/common/config/ethereum.rs
+++ b/runtime/common/config/ethereum.rs
@@ -1,28 +1,18 @@
use sp_core::{U256, H160};
use frame_support::{
- weights::{Weight, constants::WEIGHT_PER_SECOND},
- traits::{FindAuthor},
- parameter_types, ConsensusEngineId,
+ weights::{Weight, constants::WEIGHT_PER_SECOND},
+ traits::{FindAuthor},
+ parameter_types, ConsensusEngineId,
};
use sp_runtime::{RuntimeAppPublic, Perbill};
use crate::{
- runtime_common::{
- constants::*,
- dispatch::CollectionDispatchT,
- ethereum::sponsoring::EvmSponsorshipHandler,
- config::sponsoring::DefaultSponsoringRateLimit,
- DealWithFees,
- },
- Runtime,
- Aura,
- Balances,
- Event,
- ChainId,
+ runtime_common::{
+ constants::*, dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler,
+ config::sponsoring::DefaultSponsoringRateLimit, DealWithFees,
+ },
+ Runtime, Aura, Balances, Event, ChainId,
};
-use pallet_evm::{
- EnsureAddressTruncated,
- HashedAddressMapping,
-};
+use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping};
pub type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Runtime>;
@@ -116,7 +106,7 @@
}
parameter_types! {
- // 0x842899ECF380553E8a4de75bF534cdf6fBF64049
+ // 0x842899ECF380553E8a4de75bF534cdf6fBF64049
pub const HelpersContractAddress: H160 = H160([
0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49,
]);
runtime/common/config/mod.rsdiffbeforeafterboth--- a/runtime/common/config/mod.rs
+++ b/runtime/common/config/mod.rs
@@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-pub mod substrate;
pub mod ethereum;
-pub mod sponsoring;
+pub mod orml;
pub mod pallets;
pub mod parachain;
+pub mod sponsoring;
+pub mod substrate;
pub mod xcm;
-pub mod orml;
runtime/common/config/orml.rsdiffbeforeafterboth--- a/runtime/common/config/orml.rs
+++ b/runtime/common/config/orml.rs
@@ -16,10 +16,7 @@
use frame_support::parameter_types;
use frame_system::EnsureSigned;
-use crate::{
- runtime_common::constants::*,
- Runtime, Event, RelayChainBlockNumberProvider,
-};
+use crate::{runtime_common::constants::*, Runtime, Event, RelayChainBlockNumberProvider};
use common_types::{AccountId, Balance};
parameter_types! {
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -17,24 +17,18 @@
use frame_support::parameter_types;
use sp_runtime::traits::AccountIdConversion;
use crate::{
- runtime_common::{
- constants::*,
- dispatch::CollectionDispatchT,
- config::{
- substrate::TreasuryModuleId,
- ethereum::EvmCollectionHelpersAddress,
- },
- weights::CommonWeights,
- RelayChainBlockNumberProvider,
- },
- Runtime,
- Event,
- Call,
- Balances,
+ runtime_common::{
+ constants::*,
+ dispatch::CollectionDispatchT,
+ config::{substrate::TreasuryModuleId, ethereum::EvmCollectionHelpersAddress},
+ weights::CommonWeights,
+ RelayChainBlockNumberProvider,
+ },
+ Runtime, Event, Call, Balances,
};
use common_types::{AccountId, Balance, BlockNumber};
use up_data_structs::{
- mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping},
+ mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping},
};
#[cfg(feature = "rmrk")]
runtime/common/config/pallets/scheduler.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/scheduler.rs
+++ b/runtime/common/config/pallets/scheduler.rs
@@ -14,20 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-use frame_support::{
- traits::PrivilegeCmp,
- weights::Weight,
- parameter_types
-};
+use frame_support::{traits::PrivilegeCmp, weights::Weight, parameter_types};
use frame_system::EnsureSigned;
use sp_runtime::Perbill;
use sp_std::cmp::Ordering;
use crate::{
- runtime_common::{
- scheduler::SchedulerPaymentExecutor,
- config::substrate::RuntimeBlockWeights,
- },
- Runtime, Call, Event, Origin, OriginCaller, Balances
+ runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights},
+ Runtime, Call, Event, Origin, OriginCaller, Balances,
};
use common_types::AccountId;
@@ -36,7 +29,7 @@
RuntimeBlockWeights::get().max_block;
pub const MaxScheduledPerBlock: u32 = 50;
- pub const NoPreimagePostponement: Option<u32> = Some(10);
+ pub const NoPreimagePostponement: Option<u32> = Some(10);
pub const Preimage: Option<u32> = Some(10);
}
runtime/common/config/parachain.rsdiffbeforeafterboth--- a/runtime/common/config/parachain.rs
+++ b/runtime/common/config/parachain.rs
@@ -14,17 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-use frame_support::{
- weights::Weight,
- parameter_types,
-};
-use crate::{
- runtime_common::constants::*,
- Runtime,
- Event,
- XcmpQueue,
- DmpQueue,
-};
+use frame_support::{weights::Weight, parameter_types};
+use crate::{runtime_common::constants::*, Runtime, Event, XcmpQueue, DmpQueue};
parameter_types! {
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;
runtime/common/config/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/config/sponsoring.rs
+++ b/runtime/common/config/sponsoring.rs
@@ -16,16 +16,13 @@
use frame_support::parameter_types;
use crate::{
- runtime_common::{
- constants::*,
- sponsoring::UniqueSponsorshipHandler,
- },
- Runtime,
+ runtime_common::{constants::*, sponsoring::UniqueSponsorshipHandler},
+ Runtime,
};
use common_types::BlockNumber;
parameter_types! {
- pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS;
+ pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS;
}
type SponsorshipHandler = (
runtime/common/config/substrate.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18 traits::{Everything, ConstU32},19 weights::{20 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},21 DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients,22 ConstantMultiplier, WeightToFeeCoefficient,23 },24 parameter_types,25 PalletId,26};27use sp_runtime::{28 generic,29 traits::{BlakeTwo256, AccountIdLookup},30 Perbill, Permill, Percent,31};32use frame_system::{33 limits::{BlockLength, BlockWeights},34 EnsureRoot,35};36use sp_arithmetic::traits::{BaseArithmetic, Unsigned};37use smallvec::smallvec;38use crate::{39 runtime_common::{40 DealWithFees,41 constants::*,42 },43 Runtime,44 Event,45 Call,46 Origin,47 PalletInfo,48 System,49 Balances,50 Treasury,51 SS58Prefix,52 Version,53};54use common_types::*;5556parameter_types! {57 pub const BlockHashCount: BlockNumber = 2400;58 pub RuntimeBlockLength: BlockLength =59 BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);60 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);61 pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;62 pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()63 .base_block(BlockExecutionWeight::get())64 .for_class(DispatchClass::all(), |weights| {65 weights.base_extrinsic = ExtrinsicBaseWeight::get();66 })67 .for_class(DispatchClass::Normal, |weights| {68 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);69 })70 .for_class(DispatchClass::Operational, |weights| {71 weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);72 // Operational transactions have some extra reserved space, so that they73 // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.74 weights.reserved = Some(75 MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT76 );77 })78 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)79 .build_or_panic();80}8182impl frame_system::Config for Runtime {83 /// The data to be stored in an account.84 type AccountData = pallet_balances::AccountData<Balance>;85 /// The identifier used to distinguish between accounts.86 type AccountId = AccountId;87 /// The basic call filter to use in dispatchable.88 type BaseCallFilter = Everything;89 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).90 type BlockHashCount = BlockHashCount;91 /// The maximum length of a block (in bytes).92 type BlockLength = RuntimeBlockLength;93 /// The index type for blocks.94 type BlockNumber = BlockNumber;95 /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.96 type BlockWeights = RuntimeBlockWeights;97 /// The aggregated dispatch type that is available for extrinsics.98 type Call = Call;99 /// The weight of database operations that the runtime can invoke.100 type DbWeight = RocksDbWeight;101 /// The ubiquitous event type.102 type Event = Event;103 /// The type for hashing blocks and tries.104 type Hash = Hash;105 /// The hashing algorithm used.106 type Hashing = BlakeTwo256;107 /// The header type.108 type Header = generic::Header<BlockNumber, BlakeTwo256>;109 /// The index type for storing how many extrinsics an account has signed.110 type Index = Index;111 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.112 type Lookup = AccountIdLookup<AccountId, ()>;113 /// What to do if an account is fully reaped from the system.114 type OnKilledAccount = ();115 /// What to do if a new account is created.116 type OnNewAccount = ();117 type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;118 /// The ubiquitous origin type.119 type Origin = Origin;120 /// This type is being generated by `construct_runtime!`.121 type PalletInfo = PalletInfo;122 /// This is used as an identifier of the chain. 42 is the generic substrate prefix.123 type SS58Prefix = SS58Prefix;124 /// Weight information for the extrinsics of this pallet.125 type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;126 /// Version of the runtime.127 type Version = Version;128 type MaxConsumers = ConstU32<16>;129}130131impl pallet_randomness_collective_flip::Config for Runtime {}132133parameter_types! {134 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;135}136137impl pallet_timestamp::Config for Runtime {138 /// A timestamp: milliseconds since the unix epoch.139 type Moment = u64;140 type OnTimestampSet = ();141 type MinimumPeriod = MinimumPeriod;142 type WeightInfo = ();143}144145parameter_types! {146 // pub const ExistentialDeposit: u128 = 500;147 pub const ExistentialDeposit: u128 = 0;148 pub const MaxLocks: u32 = 50;149 pub const MaxReserves: u32 = 50;150}151152impl pallet_balances::Config for Runtime {153 type MaxLocks = MaxLocks;154 type MaxReserves = MaxReserves;155 type ReserveIdentifier = [u8; 16];156 /// The type for recording an account's balance.157 type Balance = Balance;158 /// The ubiquitous event type.159 type Event = Event;160 type DustRemoval = Treasury;161 type ExistentialDeposit = ExistentialDeposit;162 type AccountStore = System;163 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;164}165166parameter_types! {167 /// This value increases the priority of `Operational` transactions by adding168 /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.169 pub const OperationalFeeMultiplier: u8 = 5;170}171172/// Linear implementor of `WeightToFeePolynomial`173pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);174175impl<T> WeightToFeePolynomial for LinearFee<T>176where177 T: BaseArithmetic + From<u32> + Copy + Unsigned,178{179 type Balance = T;180181 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {182 smallvec!(WeightToFeeCoefficient {183 coeff_integer: WEIGHT_TO_FEE_COEFF.into(),184 coeff_frac: Perbill::zero(),185 negative: false,186 degree: 1,187 })188 }189}190191impl pallet_transaction_payment::Config for Runtime {192 type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;193 type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;194 type OperationalFeeMultiplier = OperationalFeeMultiplier;195 type WeightToFee = LinearFee<Balance>;196 type FeeMultiplierUpdate = ();197}198199parameter_types! {200 pub const ProposalBond: Permill = Permill::from_percent(5);201 pub const ProposalBondMinimum: Balance = 1 * UNIQUE;202 pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;203 pub const SpendPeriod: BlockNumber = 5 * MINUTES;204 pub const Burn: Permill = Permill::from_percent(0);205 pub const TipCountdown: BlockNumber = 1 * DAYS;206 pub const TipFindersFee: Percent = Percent::from_percent(20);207 pub const TipReportDepositBase: Balance = 1 * UNIQUE;208 pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;209 pub const BountyDepositBase: Balance = 1 * UNIQUE;210 pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;211 pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");212 pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;213 pub const MaximumReasonLength: u32 = 16384;214 pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);215 pub const BountyValueMinimum: Balance = 5 * UNIQUE;216 pub const MaxApprovals: u32 = 100;217}218219impl pallet_treasury::Config for Runtime {220 type PalletId = TreasuryModuleId;221 type Currency = Balances;222 type ApproveOrigin = EnsureRoot<AccountId>;223 type RejectOrigin = EnsureRoot<AccountId>;224 type Event = Event;225 type OnSlash = ();226 type ProposalBond = ProposalBond;227 type ProposalBondMinimum = ProposalBondMinimum;228 type ProposalBondMaximum = ProposalBondMaximum;229 type SpendPeriod = SpendPeriod;230 type Burn = Burn;231 type BurnDestination = ();232 type SpendFunds = ();233 type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;234 type MaxApprovals = MaxApprovals;235}236237impl pallet_sudo::Config for Runtime {238 type Event = Event;239 type Call = Call;240}241242parameter_types! {243 pub const MaxAuthorities: u32 = 100_000;244}245246impl pallet_aura::Config for Runtime {247 type AuthorityId = AuraId;248 type DisabledValidators = ();249 type MaxAuthorities = MaxAuthorities;250}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use frame_support::{18 traits::{Everything, ConstU32},19 weights::{20 constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},21 DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients, ConstantMultiplier,22 WeightToFeeCoefficient,23 },24 parameter_types, PalletId,25};26use sp_runtime::{27 generic,28 traits::{BlakeTwo256, AccountIdLookup},29 Perbill, Permill, Percent,30};31use frame_system::{32 limits::{BlockLength, BlockWeights},33 EnsureRoot,34};35use sp_arithmetic::traits::{BaseArithmetic, Unsigned};36use smallvec::smallvec;37use crate::{38 runtime_common::{DealWithFees, constants::*},39 Runtime, Event, Call, Origin, PalletInfo, System, Balances, Treasury, SS58Prefix, Version,40};41use common_types::*;4243parameter_types! {44 pub const BlockHashCount: BlockNumber = 2400;45 pub RuntimeBlockLength: BlockLength =46 BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);47 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);48 pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;49 pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()50 .base_block(BlockExecutionWeight::get())51 .for_class(DispatchClass::all(), |weights| {52 weights.base_extrinsic = ExtrinsicBaseWeight::get();53 })54 .for_class(DispatchClass::Normal, |weights| {55 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);56 })57 .for_class(DispatchClass::Operational, |weights| {58 weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);59 // Operational transactions have some extra reserved space, so that they60 // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.61 weights.reserved = Some(62 MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT63 );64 })65 .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)66 .build_or_panic();67}6869impl frame_system::Config for Runtime {70 /// The data to be stored in an account.71 type AccountData = pallet_balances::AccountData<Balance>;72 /// The identifier used to distinguish between accounts.73 type AccountId = AccountId;74 /// The basic call filter to use in dispatchable.75 type BaseCallFilter = Everything;76 /// Maximum number of block number to block hash mappings to keep (oldest pruned first).77 type BlockHashCount = BlockHashCount;78 /// The maximum length of a block (in bytes).79 type BlockLength = RuntimeBlockLength;80 /// The index type for blocks.81 type BlockNumber = BlockNumber;82 /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.83 type BlockWeights = RuntimeBlockWeights;84 /// The aggregated dispatch type that is available for extrinsics.85 type Call = Call;86 /// The weight of database operations that the runtime can invoke.87 type DbWeight = RocksDbWeight;88 /// The ubiquitous event type.89 type Event = Event;90 /// The type for hashing blocks and tries.91 type Hash = Hash;92 /// The hashing algorithm used.93 type Hashing = BlakeTwo256;94 /// The header type.95 type Header = generic::Header<BlockNumber, BlakeTwo256>;96 /// The index type for storing how many extrinsics an account has signed.97 type Index = Index;98 /// The lookup mechanism to get account ID from whatever is passed in dispatchers.99 type Lookup = AccountIdLookup<AccountId, ()>;100 /// What to do if an account is fully reaped from the system.101 type OnKilledAccount = ();102 /// What to do if a new account is created.103 type OnNewAccount = ();104 type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;105 /// The ubiquitous origin type.106 type Origin = Origin;107 /// This type is being generated by `construct_runtime!`.108 type PalletInfo = PalletInfo;109 /// This is used as an identifier of the chain. 42 is the generic substrate prefix.110 type SS58Prefix = SS58Prefix;111 /// Weight information for the extrinsics of this pallet.112 type SystemWeightInfo = frame_system::weights::SubstrateWeight<Self>;113 /// Version of the runtime.114 type Version = Version;115 type MaxConsumers = ConstU32<16>;116}117118impl pallet_randomness_collective_flip::Config for Runtime {}119120parameter_types! {121 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;122}123124impl pallet_timestamp::Config for Runtime {125 /// A timestamp: milliseconds since the unix epoch.126 type Moment = u64;127 type OnTimestampSet = ();128 type MinimumPeriod = MinimumPeriod;129 type WeightInfo = ();130}131132parameter_types! {133 // pub const ExistentialDeposit: u128 = 500;134 pub const ExistentialDeposit: u128 = 0;135 pub const MaxLocks: u32 = 50;136 pub const MaxReserves: u32 = 50;137}138139impl pallet_balances::Config for Runtime {140 type MaxLocks = MaxLocks;141 type MaxReserves = MaxReserves;142 type ReserveIdentifier = [u8; 16];143 /// The type for recording an account's balance.144 type Balance = Balance;145 /// The ubiquitous event type.146 type Event = Event;147 type DustRemoval = Treasury;148 type ExistentialDeposit = ExistentialDeposit;149 type AccountStore = System;150 type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;151}152153parameter_types! {154 /// This value increases the priority of `Operational` transactions by adding155 /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`.156 pub const OperationalFeeMultiplier: u8 = 5;157}158159/// Linear implementor of `WeightToFeePolynomial`160pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);161162impl<T> WeightToFeePolynomial for LinearFee<T>163where164 T: BaseArithmetic + From<u32> + Copy + Unsigned,165{166 type Balance = T;167168 fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {169 smallvec!(WeightToFeeCoefficient {170 coeff_integer: WEIGHT_TO_FEE_COEFF.into(),171 coeff_frac: Perbill::zero(),172 negative: false,173 degree: 1,174 })175 }176}177178impl pallet_transaction_payment::Config for Runtime {179 type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees>;180 type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;181 type OperationalFeeMultiplier = OperationalFeeMultiplier;182 type WeightToFee = LinearFee<Balance>;183 type FeeMultiplierUpdate = ();184}185186parameter_types! {187 pub const ProposalBond: Permill = Permill::from_percent(5);188 pub const ProposalBondMinimum: Balance = 1 * UNIQUE;189 pub const ProposalBondMaximum: Balance = 1000 * UNIQUE;190 pub const SpendPeriod: BlockNumber = 5 * MINUTES;191 pub const Burn: Permill = Permill::from_percent(0);192 pub const TipCountdown: BlockNumber = 1 * DAYS;193 pub const TipFindersFee: Percent = Percent::from_percent(20);194 pub const TipReportDepositBase: Balance = 1 * UNIQUE;195 pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE;196 pub const BountyDepositBase: Balance = 1 * UNIQUE;197 pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;198 pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry");199 pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;200 pub const MaximumReasonLength: u32 = 16384;201 pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);202 pub const BountyValueMinimum: Balance = 5 * UNIQUE;203 pub const MaxApprovals: u32 = 100;204}205206impl pallet_treasury::Config for Runtime {207 type PalletId = TreasuryModuleId;208 type Currency = Balances;209 type ApproveOrigin = EnsureRoot<AccountId>;210 type RejectOrigin = EnsureRoot<AccountId>;211 type Event = Event;212 type OnSlash = ();213 type ProposalBond = ProposalBond;214 type ProposalBondMinimum = ProposalBondMinimum;215 type ProposalBondMaximum = ProposalBondMaximum;216 type SpendPeriod = SpendPeriod;217 type Burn = Burn;218 type BurnDestination = ();219 type SpendFunds = ();220 type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;221 type MaxApprovals = MaxApprovals;222}223224impl pallet_sudo::Config for Runtime {225 type Event = Event;226 type Call = Call;227}228229parameter_types! {230 pub const MaxAuthorities: u32 = 100_000;231}232233impl pallet_aura::Config for Runtime {234 type AuthorityId = AuraId;235 type DisabledValidators = ();236 type MaxAuthorities = MaxAuthorities;237}runtime/common/config/xcm.rsdiffbeforeafterboth--- a/runtime/common/config/xcm.rs
+++ b/runtime/common/config/xcm.rs
@@ -15,19 +15,15 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use frame_support::{
- traits::{
- tokens::currency::Currency as CurrencyT,
- OnUnbalanced as OnUnbalancedT,
- Get, Everything
- },
- weights::{Weight, WeightToFeePolynomial, WeightToFee},
- parameter_types, match_types,
+ traits::{
+ tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything,
+ },
+ weights::{Weight, WeightToFeePolynomial, WeightToFee},
+ parameter_types, match_types,
};
use frame_system::EnsureRoot;
use sp_runtime::{
- traits::{
- Saturating, CheckedConversion, Zero,
- },
+ traits::{Saturating, CheckedConversion, Zero},
SaturatedConversion,
};
use pallet_xcm::XcmPassthrough;
@@ -36,8 +32,7 @@
use xcm::latest::{
AssetId::{Concrete},
Fungibility::Fungible as XcmFungible,
- MultiAsset,
- Error as XcmError,
+ MultiAsset, Error as XcmError,
};
use xcm_executor::traits::{MatchesFungible, WeightTrader};
use xcm_builder::{
@@ -49,19 +44,8 @@
use xcm_executor::{Config, XcmExecutor, Assets};
use sp_std::marker::PhantomData;
use crate::{
- runtime_common::{
- constants::*,
- config::substrate::LinearFee
- },
- Runtime,
- Call,
- Event,
- Origin,
- Balances,
- ParachainInfo,
- ParachainSystem,
- PolkadotXcm,
- XcmpQueue,
+ runtime_common::{constants::*, config::substrate::LinearFee},
+ Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue,
};
use common_types::{AccountId, Balance};
runtime/common/ethereum/mod.rsdiffbeforeafterboth--- a/runtime/common/ethereum/mod.rs
+++ b/runtime/common/ethereum/mod.rs
@@ -14,6 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+pub mod self_contained_call;
pub mod sponsoring;
pub mod transaction_converter;
-pub mod self_contained_call;
runtime/common/ethereum/self_contained_call.rsdiffbeforeafterboth--- a/runtime/common/ethereum/self_contained_call.rs
+++ b/runtime/common/ethereum/self_contained_call.rs
@@ -16,8 +16,8 @@
use sp_core::H160;
use sp_runtime::{
- traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf},
- transaction_validity::{TransactionValidityError, TransactionValidity},
+ traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf},
+ transaction_validity::{TransactionValidityError, TransactionValidity},
};
use crate::{Origin, Call};
runtime/common/ethereum/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/ethereum/sponsoring.rs
+++ b/runtime/common/ethereum/sponsoring.rs
@@ -27,10 +27,7 @@
use up_data_structs::{TokenId, CreateItemData, CreateNftData, CollectionMode};
use pallet_unique::Config as UniqueConfig;
-use crate::{
- Runtime,
- runtime_common::sponsoring::*
-};
+use crate::{Runtime, runtime_common::sponsoring::*};
use pallet_nonfungible::erc::{
UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, TokenPropertiesCall,
runtime/common/ethereum/transaction_converter.rsdiffbeforeafterboth--- a/runtime/common/ethereum/transaction_converter.rs
+++ b/runtime/common/ethereum/transaction_converter.rs
@@ -15,11 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use codec::{Encode, Decode};
-use crate::{
- opaque,
- Runtime,
- UncheckedExtrinsic,
-};
+use crate::{opaque, Runtime, UncheckedExtrinsic};
pub struct TransactionConverter;
runtime/common/instance.rsdiffbeforeafterboth--- a/runtime/common/instance.rs
+++ b/runtime/common/instance.rs
@@ -1,9 +1,8 @@
use crate::{
- runtime_common::{
- config::ethereum::CrossAccountId,
- ethereum::transaction_converter::TransactionConverter
- },
- Runtime,
+ runtime_common::{
+ config::ethereum::CrossAccountId, ethereum::transaction_converter::TransactionConverter,
+ },
+ Runtime,
};
use common_types::opaque::RuntimeInstance;
runtime/common/mod.rsdiffbeforeafterboth--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -14,23 +14,23 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+pub mod config;
pub mod constants;
pub mod construct_runtime;
pub mod dispatch;
+pub mod ethereum;
+pub mod instance;
pub mod runtime_apis;
+pub mod scheduler;
pub mod sponsoring;
pub mod weights;
-pub mod config;
-pub mod instance;
-pub mod ethereum;
-pub mod scheduler;
use sp_core::H160;
use frame_support::traits::{Currency, OnUnbalanced, Imbalance};
use sp_runtime::{
- generic,
- traits::{BlakeTwo256, BlockNumberProvider},
- impl_opaque_keys,
+ generic,
+ traits::{BlakeTwo256, BlockNumberProvider},
+ impl_opaque_keys,
};
use sp_std::vec::Vec;
@@ -38,7 +38,7 @@
use sp_version::NativeVersion;
use crate::{
- Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst,
+ Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst,
InherentDataExt,
};
use common_types::{AccountId, BlockNumber};
runtime/common/scheduler.rsdiffbeforeafterboth--- a/runtime/common/scheduler.rs
+++ b/runtime/common/scheduler.rs
@@ -15,19 +15,16 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use frame_support::{
- traits::NamedReservableCurrency,
- weights::{GetDispatchInfo, PostDispatchInfo, DispatchInfo},
+ traits::NamedReservableCurrency,
+ weights::{GetDispatchInfo, PostDispatchInfo, DispatchInfo},
};
use sp_runtime::{
- traits::{Dispatchable, Applyable, Member},
+ traits::{Dispatchable, Applyable, Member},
generic::Era,
- transaction_validity::TransactionValidityError,
+ transaction_validity::TransactionValidityError,
DispatchErrorWithPostInfo, DispatchError,
-};
-use crate::{
- Runtime, Call, Origin, Balances,
- ChargeTransactionPayment,
};
+use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment};
use common_types::{AccountId, Balance};
use fp_self_contained::SelfContainedCall;
use pallet_unique_scheduler::DispatchCall;
@@ -85,11 +82,11 @@
SignedExtraScheduler,
SelfContainedSignedInfo,
> {
- signed:
- fp_self_contained::CheckedSignature::<AccountId, SignedExtraScheduler, SelfContainedSignedInfo>::Signed(
- signer.clone().into(),
- get_signed_extras(signer.into()),
- ),
+ signed: fp_self_contained::CheckedSignature::<
+ AccountId,
+ SignedExtraScheduler,
+ SelfContainedSignedInfo,
+ >::Signed(signer.clone().into(), get_signed_extras(signer.into())),
function: call.into(),
};