diff --git a/pallets/duniter-account/src/lib.rs b/pallets/duniter-account/src/lib.rs index 3e7154a49d357403d60c7723746e6810590fc844..76209d0427d0cb2bcb5ede65795a0796d594ba5e 100644 --- a/pallets/duniter-account/src/lib.rs +++ b/pallets/duniter-account/src/lib.rs @@ -29,11 +29,13 @@ pub use types::*; pub use weights::WeightInfo; use core::cmp; +#[cfg(feature = "runtime-benchmarks")] +use frame_support::traits::tokens::fungible::Mutate; use frame_support::{ pallet_prelude::*, traits::{ fungible, - fungible::{Credit, Inspect, Mutate}, + fungible::{Credit, Inspect}, tokens::WithdrawConsequence, IsSubType, StorageVersion, StoredMap, }, diff --git a/primitives/duniter/src/lib.rs b/primitives/duniter/src/lib.rs index 1d71c0a590bb651a031afed211d113477b40ee12..00f657bff42825ce247d4583d99cef61a6168828 100644 --- a/primitives/duniter/src/lib.rs +++ b/primitives/duniter/src/lib.rs @@ -20,9 +20,10 @@ /// - Bound length to 42 /// - accept only ascii alphanumeric or - or _ pub fn validate_idty_name(idty_name: &[u8]) -> bool { + // length smaller than 42 + // all characters are alphanumeric or - or _ idty_name.len() >= 3 - && idty_name.len() <= 42 // length smaller than 42 - // all characters are alphanumeric or - or _ + && idty_name.len() <= 42 && idty_name .iter() .all(|c| c.is_ascii_alphanumeric() || *c == b'-' || *c == b'_') diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index cdd4e0e936fe3ac1db84080b691070dd22e01496..694fdec255b008068a2b530b193d8d56050e0ca8 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -16,9 +16,7 @@ #[macro_export] macro_rules! pallets_config { - {$($custom:tt)*} => { - $($custom)* - + () => { // SYSTEM // parameter_types! { @@ -26,59 +24,59 @@ macro_rules! pallets_config { } impl frame_system::Config for Runtime { + /// The data to be stored in an account. + type AccountData = pallet_duniter_account::AccountData<Balance, IdtyIndex>; + /// The identifier used to distinguish between accounts. + type AccountId = AccountId; /// The basic call filter to use in dispatchable. type BaseCallFilter = BaseCallFilter; - /// Block & extrinsics weights: base values and limits. - type BlockWeights = BlockWeights; + /// The block type for the runtime. + type Block = Block; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; /// The maximum length of a block (in bytes). type BlockLength = BlockLength; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup<AccountId, ()>; + /// Block & extrinsics weights: base values and limits. + type BlockWeights = BlockWeights; + /// The weight of database operations that the runtime can invoke. + type DbWeight = DbWeight; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// The weight of database operations that the runtime can invoke. - type DbWeight = DbWeight; - /// Version of the runtime. - type Version = Version; + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. + type Lookup = AccountIdLookup<AccountId, ()>; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type MultiBlockMigrator = (); + /// The type for storing how many extrinsics an account has signed. + type Nonce = node_primitives::Nonce; + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// What to do if a new account is created. + type OnNewAccount = (); + /// The set code logic, just the default since we're not a parachain. + type OnSetCode = (); /// Converts a module to the index of the module in `construct_runtime!`. /// /// This type is being generated by `construct_runtime!`. type PalletInfo = PalletInfo; - /// What to do if a new account is created. - type OnNewAccount = (); - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); - /// The data to be stored in an account. - type AccountData = pallet_duniter_account::AccountData<Balance, IdtyIndex>; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = common_runtime::weights::frame_system::WeightInfo<Runtime>; + type PostInherents = (); + type PostTransactions = (); + type PreInherents = (); + /// The aggregated dispatch type that is available for extrinsics. + type RuntimeCall = RuntimeCall; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + /// The ubiquitous origin type. + type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = (); /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; - /// The set code logic, just the default since we're not a parachain. - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - /// The type for storing how many extrinsics an account has signed. - type Nonce = node_primitives::Nonce; - /// The block type for the runtime. - type Block = Block; - type RuntimeTask = (); type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = common_runtime::weights::frame_system::WeightInfo<Runtime>; + /// Version of the runtime. + type Version = Version; } // SCHEDULER // @@ -90,26 +88,26 @@ macro_rules! pallets_config { pub const NoPreimagePostponement: Option<u32> = Some(10); } impl pallet_scheduler::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type MaximumWeight = MaximumSchedulerWeight; + type OriginPrivilegeCmp = EqualPrivilegeOnly; type PalletsOrigin = OriginCaller; + type Preimages = Preimage; type RuntimeCall = RuntimeCall; - type MaximumWeight = MaximumSchedulerWeight; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type ScheduleOrigin = EnsureRoot<AccountId>; - type OriginPrivilegeCmp = EqualPrivilegeOnly; - type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = common_runtime::weights::pallet_scheduler::WeightInfo<Runtime>; - type Preimages = Preimage; } // ACCOUNT // impl pallet_duniter_account::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = common_runtime::weights::pallet_duniter_account::WeightInfo<Runtime>; // does currency adapter in any case, but adds "refund with quota" feature type InnerOnChargeTransaction = FungibleAdapter<Balances, HandleFees>; type Refund = Quota; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = common_runtime::weights::pallet_duniter_account::WeightInfo<Runtime>; } // QUOTA // @@ -122,61 +120,58 @@ macro_rules! pallets_config { } } parameter_types! { - pub const ReloadRate: BlockNumber = 1 * HOURS; // faster than DAYS - pub const MaxQuota: Balance = 1000; // 10 ĞD - pub const MaxNominators: u32 = 64; -pub TreasuryAccount: AccountId = Treasury::account_id(); // TODO - } + pub const ReloadRate: BlockNumber = 1 * HOURS; // faster than DAYS + pub const MaxQuota: Balance = 1000; // 10 ĞD + pub const MaxNominators: u32 = 64; + pub TreasuryAccount: AccountId = Treasury::account_id(); // TODO + } impl pallet_quota::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - // type IdtyId = IdtyIndex; - type ReloadRate = ReloadRate; type MaxQuota = MaxQuota; type RefundAccount = TreasuryAccountId; + type ReloadRate = ReloadRate; + type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_quota::WeightInfo<Runtime>; } // BLOCK CREATION // impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ExpectedBlockTime; + type DisabledValidators = Session; // session module is the trigger type EpochChangeTrigger = pallet_babe::ExternalTrigger; - type DisabledValidators = Session; - type KeyOwnerProof = <Historical as KeyOwnerProofSystem<( - KeyTypeId, - pallet_babe::AuthorityId, - )>>::Proof; + type EpochDuration = EpochDuration; type EquivocationReportSystem = pallet_babe::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>; - type WeightInfo = common_runtime::weights::pallet_babe::WeightInfo<Runtime>; + type ExpectedBlockTime = ExpectedBlockTime; + type KeyOwnerProof = + <Historical as KeyOwnerProofSystem<(KeyTypeId, pallet_babe::AuthorityId)>>::Proof; type MaxAuthorities = MaxAuthorities; -type MaxNominators = MaxNominators; + type MaxNominators = MaxNominators; + type WeightInfo = common_runtime::weights::pallet_babe::WeightInfo<Runtime>; } impl pallet_timestamp::Config for Runtime { + type MinimumPeriod = MinimumPeriod; type Moment = u64; type OnTimestampSet = (Babe, UniversalDividend); - type MinimumPeriod = MinimumPeriod; type WeightInfo = common_runtime::weights::pallet_timestamp::WeightInfo<Runtime>; } // MONEY MANAGEMENT // impl pallet_balances::Config for Runtime { - type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = (); - type RuntimeEvent = RuntimeEvent; - type MaxLocks = MaxLocks; - type MaxReserves = frame_support::pallet_prelude::ConstU32<5>; - type ReserveIdentifier = [u8; 8]; + type AccountStore = Account; type Balance = Balance; type DustRemoval = HandleFees; type ExistentialDeposit = ExistentialDeposit; - type AccountStore = Account; type FreezeIdentifier = (); type MaxFreezes = frame_support::pallet_prelude::ConstU32<0>; + type MaxLocks = MaxLocks; + type MaxReserves = frame_support::pallet_prelude::ConstU32<5>; + type ReserveIdentifier = [u8; 8]; + type RuntimeEvent = RuntimeEvent; + type RuntimeFreezeReason = (); + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = common_runtime::weights::pallet_balances::WeightInfo<Runtime>; } @@ -185,32 +180,33 @@ type MaxNominators = MaxNominators; impl frame_support::traits::OnUnbalanced<CreditOf> for HandleFees { fn on_nonzero_unbalanced(amount: CreditOf) { // fee is moved to treasury - let _ = Balances::deposit(&Treasury::account_id(), amount.peek(), frame_support::traits::tokens::Precision::Exact); - // should move the tip to author - // if let Some(author) = Authorship::author() { - // Balances::resolve_creating(&author, amount); - // } + let _ = Balances::deposit( + &Treasury::account_id(), + amount.peek(), + frame_support::traits::tokens::Precision::Exact, + ); } } pub struct OnChargeTransaction; parameter_types! { - pub FeeMultiplier: pallet_transaction_payment::Multiplier = pallet_transaction_payment::Multiplier::one(); + pub FeeMultiplier: Multiplier = Multiplier::one(); } impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; + type FeeMultiplierUpdate = + pallet_transaction_payment::ConstFeeMultiplier<FeeMultiplier>; + type LengthToFee = common_runtime::fees::LengthToFeeImpl<Balance>; // does a filter on the call type OnChargeTransaction = OneshotAccount; type OperationalFeeMultiplier = frame_support::traits::ConstU8<5>; + type RuntimeEvent = RuntimeEvent; type WeightToFee = common_runtime::fees::WeightToFeeImpl<Balance>; - type LengthToFee = common_runtime::fees::LengthToFeeImpl<Balance>; - type FeeMultiplierUpdate = pallet_transaction_payment::ConstFeeMultiplier<FeeMultiplier>; } impl pallet_oneshot_account::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type Currency = Balances; // when call is not oneshot account, fall back to duniter-account implementation type InnerOnChargeTransaction = Account; + type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_oneshot_account::WeightInfo<Runtime>; } @@ -220,49 +216,51 @@ type MaxNominators = MaxNominators; type MaxAuthorities = MaxAuthorities; } impl pallet_authority_members::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type IsMember = SmithMembers; - type OnNewSession = OnNewSessionHandler<Runtime>; + type MaxAuthorities = MaxAuthorities; type MemberId = IdtyIndex; type MemberIdOf = common_runtime::providers::IdentityIndexOf<Self>; - type MaxAuthorities = MaxAuthorities; - type RemoveMemberOrigin = EnsureRoot<Self::AccountId>; - type WeightInfo = common_runtime::weights::pallet_authority_members::WeightInfo<Runtime>; type OnIncomingMember = SmithMembers; + type OnNewSession = OnNewSessionHandler<Runtime>; type OnOutgoingMember = SmithMembers; + type RemoveMemberOrigin = EnsureRoot<Self::AccountId>; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = + common_runtime::weights::pallet_authority_members::WeightInfo<Runtime>; } impl pallet_authorship::Config for Runtime { type EventHandler = ImOnline; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; } impl pallet_im_online::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type AuthorityId = ImOnlineId; - type ValidatorSet = Historical; - type NextSessionRotation = Babe; - type ReportUnresponsiveness = Offences; - type UnsignedPriority = ImOnlineUnsignedPriority; - type WeightInfo = common_runtime::weights::pallet_im_online::WeightInfo<Runtime>; #[cfg(not(feature = "runtime-benchmarks"))] type MaxKeys = MaxAuthorities; #[cfg(feature = "runtime-benchmarks")] - type MaxKeys = frame_support::traits::ConstU32<1_000>; // At least 1000 to be benchmarkable see https://github.com/paritytech/substrate/blob/e94cb0dafd4f30ff29512c1c00ec513ada7d2b5d/frame/im-online/src/benchmarking.rs#L35 + type MaxKeys = frame_support::traits::ConstU32<1_000>; type MaxPeerInHeartbeats = MaxPeerInHeartbeats; + type NextSessionRotation = Babe; + type ReportUnresponsiveness = Offences; + type RuntimeEvent = RuntimeEvent; + type UnsignedPriority = ImOnlineUnsignedPriority; + type ValidatorSet = Historical; + type WeightInfo = common_runtime::weights::pallet_im_online::WeightInfo<Runtime>; } impl pallet_offences::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>; type OnOffenceHandler = AuthorityMembers; + type RuntimeEvent = RuntimeEvent; } impl pallet_session::Config for Runtime { + type Keys = opaque::SessionKeys; + type NextSessionRotation = Babe; type RuntimeEvent = RuntimeEvent; + type SessionHandler = <opaque::SessionKeys as OpaqueKeys>::KeyTypeIdProviders; + type SessionManager = + pallet_session::historical::NoteHistoricalRoot<Self, AuthorityMembers>; + type ShouldEndSession = Babe; type ValidatorId = AccountId; type ValidatorIdOf = sp_runtime::traits::ConvertInto; - type ShouldEndSession = Babe; - type NextSessionRotation = Babe; - type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, AuthorityMembers>; - type SessionHandler = <opaque::SessionKeys as OpaqueKeys>::KeyTypeIdProviders; - type Keys = opaque::SessionKeys; type WeightInfo = common_runtime::weights::pallet_session::WeightInfo<Runtime>; } impl pallet_session::historical::Config for Runtime { @@ -270,16 +268,19 @@ type MaxNominators = MaxNominators; type FullIdentificationOf = FullIdentificationOfImpl; } impl pallet_grandpa::Config for Runtime { + type EquivocationReportSystem = pallet_grandpa::EquivocationReportSystem< + Self, + Offences, + Historical, + ReportLongevity, + >; + type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof; + type MaxAuthorities = MaxAuthorities; + type MaxNominators = frame_support::traits::ConstU32<64>; + type MaxSetIdSessionEntries = MaxSetIdSessionEntries; type RuntimeEvent = RuntimeEvent; - type KeyOwnerProof = - <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof; - type EquivocationReportSystem = - pallet_grandpa::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>; type WeightInfo = common_runtime::weights::pallet_grandpa::WeightInfo<Runtime>; - type MaxAuthorities = MaxAuthorities; - type MaxSetIdSessionEntries = MaxSetIdSessionEntries; - type MaxNominators = frame_support::traits::ConstU32<64>; - } + } parameter_types! { // BondingDuration::get() * SessionsPerEra::get(); pub const MaxSetIdSessionEntries: u32 = 1000; @@ -287,22 +288,26 @@ type MaxNominators = MaxNominators; // ONCHAIN GOVERNANCE // - #[cfg(feature = "runtime-benchmarks")] - parameter_types! { - pub const WorstCaseOrigin: pallet_collective::RawOrigin<AccountId, TechnicalCommitteeInstance> = - pallet_collective::RawOrigin::<AccountId, TechnicalCommitteeInstance>::Members(2, 3); - } - - impl pallet_upgrade_origin::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Call = RuntimeCall; - type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>; - type WeightInfo = common_runtime::weights::pallet_upgrade_origin::WeightInfo<Runtime>; - #[cfg(feature = "runtime-benchmarks")] - type WorstCaseOriginType = pallet_collective::RawOrigin<AccountId, TechnicalCommitteeInstance>; - #[cfg(feature = "runtime-benchmarks")] - type WorstCaseOrigin = WorstCaseOrigin; - } + #[cfg(feature = "runtime-benchmarks")] + parameter_types! { + pub const WorstCaseOrigin: WorstOrigin = WorstOrigin::Members(2, 3); + } + + impl pallet_upgrade_origin::Config for Runtime { + type Call = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast< + AccountId, + TechnicalCommitteeInstance, + 2, + 3, + >; + type WeightInfo = common_runtime::weights::pallet_upgrade_origin::WeightInfo<Runtime>; + #[cfg(feature = "runtime-benchmarks")] + type WorstCaseOrigin = WorstCaseOrigin; + #[cfg(feature = "runtime-benchmarks")] + type WorstCaseOriginType = RawOrigin<AccountId, TechnicalCommitteeInstance>; + } parameter_types! { pub const PreimageMaxSize: u32 = 4096 * 1024; @@ -311,32 +316,33 @@ type MaxNominators = MaxNominators; } impl pallet_preimage::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = common_runtime::weights::pallet_preimage::WeightInfo<Runtime>; + type Consideration = (); type Currency = Balances; type ManagerOrigin = EnsureRoot<AccountId>; - type Consideration = (); + type RuntimeEvent = RuntimeEvent; + type WeightInfo = common_runtime::weights::pallet_preimage::WeightInfo<Runtime>; } // UTILITIES // impl pallet_atomic_swap::Config for Runtime { + type ProofLimit = frame_support::traits::ConstU32<1_024>; type RuntimeEvent = RuntimeEvent; type SwapAction = pallet_atomic_swap::BalanceSwapAction<AccountId, Balances>; - type ProofLimit = frame_support::traits::ConstU32<1_024>; } impl pallet_provide_randomness::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type Currency = Balances; type GetCurrentEpochIndex = GetCurrentEpochIndex<Self>; type MaxRequests = frame_support::traits::ConstU32<100>; - type RequestPrice = frame_support::traits::ConstU64<2_000>; type OnFilledRandomness = (); type OnUnbalanced = HandleFees; type ParentBlockRandomness = pallet_babe::ParentBlockRandomness<Self>; type RandomnessFromOneEpochAgo = pallet_babe::RandomnessFromOneEpochAgo<Self>; - type WeightInfo = common_runtime::weights::pallet_provide_randomness::WeightInfo<Runtime>; + type RequestPrice = frame_support::traits::ConstU64<2_000>; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = + common_runtime::weights::pallet_provide_randomness::WeightInfo<Runtime>; } parameter_types! { @@ -348,17 +354,17 @@ type MaxNominators = MaxNominators; pub const AnnouncementDepositFactor: Balance = deposit(0, 66); } impl pallet_proxy::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; + type CallHasher = BlakeTwo256; type Currency = Balances; - type ProxyType = ProxyType; + type MaxPending = frame_support::traits::ConstU32<32>; + type MaxProxies = frame_support::traits::ConstU32<32>; type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = frame_support::traits::ConstU32<32>; - type MaxPending = frame_support::traits::ConstU32<32>; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; + type ProxyType = ProxyType; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_proxy::WeightInfo<Runtime>; } @@ -367,19 +373,19 @@ type MaxNominators = MaxNominators; pub const DepositFactor: Balance = DEPOSIT_PER_BYTE * 32; } impl pallet_multisig::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; type MaxSignatories = MaxSignatories; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_multisig::WeightInfo<Runtime>; } impl pallet_utility::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_utility::WeightInfo<Runtime>; } @@ -394,62 +400,64 @@ type MaxNominators = MaxNominators; } impl pallet_treasury::Config for Runtime { type ApproveOrigin = TreasuryApproveOrigin; + type AssetKind = (); + type BalanceConverter = frame_support::traits::tokens::UnityAssetBalanceConversion; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); + type Beneficiary = AccountId; + type BeneficiaryLookup = AccountIdLookup<AccountId, ()>; type Burn = Burn; type BurnDestination = (); type Currency = Balances; - type RuntimeEvent = RuntimeEvent; + type MaxApprovals = frame_support::traits::ConstU32<100>; type OnSlash = Treasury; + type PalletId = TreasuryPalletId; + type Paymaster = + frame_support::traits::tokens::pay::PayFromAccount<Balances, TreasuryAccount>; + type PayoutPeriod = sp_core::ConstU32<10>; type ProposalBond = ProposalBond; - type ProposalBondMinimum = frame_support::traits::ConstU64<10_000>; type ProposalBondMaximum = ProposalBondMaximum; - type MaxApprovals = frame_support::traits::ConstU32<100>; - type PalletId = TreasuryPalletId; + type ProposalBondMinimum = frame_support::traits::ConstU64<10_000>; type RejectOrigin = TreasuryRejectOrigin; + type RuntimeEvent = RuntimeEvent; type SpendFunds = TreasurySpendFunds<Self>; - type SpendPeriod = SpendPeriod; type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>; + type SpendPeriod = SpendPeriod; type WeightInfo = common_runtime::weights::pallet_treasury::WeightInfo<Runtime>; - type AssetKind = (); - type Beneficiary = AccountId; - type BeneficiaryLookup = AccountIdLookup<AccountId, ()>; - type Paymaster = frame_support::traits::tokens::pay::PayFromAccount<Balances, TreasuryAccount>; - type BalanceConverter = frame_support::traits::tokens::UnityAssetBalanceConversion; - type PayoutPeriod = sp_core::ConstU32<10>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } // UNIVERSAL DIVIDEND // - pub struct MembersCount; - impl frame_support::pallet_prelude::Get<Balance> for MembersCount { - fn get() -> Balance { - <Membership as sp_membership::traits::MembersCount>::members_count() as Balance - } - } + pub struct MembersCount; + impl frame_support::pallet_prelude::Get<Balance> for MembersCount { + fn get() -> Balance { + <Membership as sp_membership::traits::MembersCount>::members_count() as Balance + } + } impl pallet_universal_dividend::Config for Runtime { - type MomentIntoBalance = sp_runtime::traits::ConvertInto; type Currency = Balances; - type RuntimeEvent = RuntimeEvent; - type MaxPastReeval = frame_support::traits::ConstU32<160>; + #[cfg(feature = "runtime-benchmarks")] + type IdtyAttr = Identity; + type MaxPastReeval = frame_support::traits::ConstU32<160>; type MembersCount = MembersCount; type MembersStorage = common_runtime::providers::UdMembersStorage<Runtime>; + type MomentIntoBalance = sp_runtime::traits::ConvertInto; + type RuntimeEvent = RuntimeEvent; type SquareMoneyGrowthRate = SquareMoneyGrowthRate; type UdCreationPeriod = UdCreationPeriod; type UdReevalPeriod = UdReevalPeriod; type UnitsPerUd = frame_support::traits::ConstU64<1_000>; - type WeightInfo = common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>; - #[cfg(feature = "runtime-benchmarks")] - type IdtyAttr = Identity; + type WeightInfo = + common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>; } // WEB OF TRUST // impl pallet_duniter_wot::Config for Runtime { type FirstIssuableOn = WotFirstCertIssuableOn; - type MinCertForMembership = WotMinCertForMembership; type MinCertForCreateIdtyRight = WotMinCertForCreateIdtyRight; + type MinCertForMembership = WotMinCertForMembership; } parameter_types! { @@ -457,87 +465,87 @@ type MaxNominators = MaxNominators; pub const DeletionPeriod: BlockNumber = 10 * YEARS; } impl pallet_identity::Config for Runtime { - type ChangeOwnerKeyPeriod = ChangeOwnerKeyPeriod; - type ConfirmPeriod = ConfirmPeriod; - type ValidationPeriod = ValidationPeriod; + type AccountLinker = Account; type AutorevocationPeriod = AutorevocationPeriod; - type DeletionPeriod = DeletionPeriod; + type ChangeOwnerKeyPeriod = ChangeOwnerKeyPeriod; + type CheckAccountWorthiness = Account; type CheckIdtyCallAllowed = Wot; - type CheckAccountWorthiness = Account; + type ConfirmPeriod = ConfirmPeriod; + type DeletionPeriod = DeletionPeriod; type IdtyCreationPeriod = IdtyCreationPeriod; - type IdtyData = IdtyData; + type IdtyData = IdtyData; type IdtyIndex = IdtyIndex; - type AccountLinker = Account; type IdtyNameValidator = IdtyNameValidatorImpl; - type Signer = <Signature as sp_runtime::traits::Verify>::Signer; - type Signature = Signature; type OnNewIdty = OnNewIdtyHandler<Runtime>; type OnRemoveIdty = OnRemoveIdtyHandler<Runtime>; type RuntimeEvent = RuntimeEvent; + type Signature = Signature; + type Signer = <Signature as sp_runtime::traits::Verify>::Signer; + type ValidationPeriod = ValidationPeriod; type WeightInfo = common_runtime::weights::pallet_identity::WeightInfo<Runtime>; } - impl pallet_sudo::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>; - } + impl pallet_sudo::Config for Runtime { + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>; + } impl pallet_membership::Config for Runtime { + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetupHandler = common_runtime::providers::BenchmarkSetupHandler<Runtime>; type CheckMembershipOpAllowed = Wot; - type IdtyId = IdtyIndex; type IdtyAttr = Identity; + type IdtyId = IdtyIndex; type MembershipPeriod = MembershipPeriod; type MembershipRenewalPeriod = MembershipRenewalPeriod; type OnNewMembership = OnNewMembershipHandler<Runtime>; type OnRemoveMembership = OnRemoveMembershipHandler<Runtime>; type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_membership::WeightInfo<Runtime>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = common_runtime::providers::BenchmarkSetupHandler<Runtime>; } impl pallet_certification::Config for Runtime { type CertPeriod = CertPeriod; - type IdtyIndex = IdtyIndex; - type IdtyAttr = Identity; type CheckCertAllowed = Wot; + type IdtyAttr = Identity; + type IdtyIndex = IdtyIndex; type MaxByIssuer = MaxByIssuer; type MinReceivedCertToBeAbleToIssueCert = MinReceivedCertToBeAbleToIssueCert; type OnNewcert = Wot; type OnRemovedCert = Wot; type RuntimeEvent = RuntimeEvent; - type WeightInfo = common_runtime::weights::pallet_certification::WeightInfo<Runtime>; type ValidityPeriod = ValidityPeriod; + type WeightInfo = common_runtime::weights::pallet_certification::WeightInfo<Runtime>; } parameter_types! { pub const MinAccessibleReferees: Perbill = Perbill::from_percent(80); } impl pallet_distance::Config for Runtime { + type CheckRequestDistanceEvaluation = Wot; type Currency = Balances; type EvaluationPeriod = frame_support::traits::ConstU32<7>; type EvaluationPrice = frame_support::traits::ConstU64<1000>; type MaxRefereeDistance = frame_support::traits::ConstU32<5>; type MinAccessibleReferees = MinAccessibleReferees; - type RuntimeHoldReason = RuntimeHoldReason; + type OnValidDistanceStatus = Wot; type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = common_runtime::weights::pallet_distance::WeightInfo<Runtime>; - type OnValidDistanceStatus = Wot; - type CheckRequestDistanceEvaluation = Wot; } // SMITH-MEMBERS impl pallet_smith_members::Config for Runtime { - type RuntimeEvent = RuntimeEvent; + type IdtyAttr = Identity; + type IdtyIdOfAuthorityId = sp_runtime::traits::ConvertInto; type IdtyIndex = IdtyIndex; type IsWoTMember = common_runtime::providers::IsWoTMemberProvider<Runtime>; - type IdtyAttr = Identity; - type MinCertForMembership = SmithWotMinCertForMembership; type MaxByIssuer = SmithMaxByIssuer; - type SmithInactivityMaxDuration = SmithInactivityMaxDuration; - type OnSmithDelete = OnSmithDeletedHandler<Runtime>; - type IdtyIdOfAuthorityId = sp_runtime::traits::ConvertInto; type MemberId = IdtyIndex; + type MinCertForMembership = SmithWotMinCertForMembership; + type OnSmithDelete = OnSmithDeletedHandler<Runtime>; + type RuntimeEvent = RuntimeEvent; + type SmithInactivityMaxDuration = SmithInactivityMaxDuration; type WeightInfo = common_runtime::weights::pallet_smith_members::WeightInfo<Runtime>; } @@ -554,22 +562,22 @@ type MaxNominators = MaxNominators; } parameter_types! { pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * DAYS; - pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block; + pub MaxWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block; } impl pallet_collective::Config<Instance2> for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Proposal = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type MotionDuration = TechnicalCommitteeMotionDuration; - type MaxProposals = frame_support::pallet_prelude::ConstU32<20>; - type MaxMembers = frame_support::pallet_prelude::ConstU32<100>; - type WeightInfo = common_runtime::weights::pallet_collective::WeightInfo<Runtime>; - type SetMembersOrigin = EnsureRoot<AccountId>; - type MaxProposalWeight = MaxProposalWeight; #[cfg(not(feature = "runtime-benchmarks"))] type DefaultVote = TechnicalCommitteeDefaultVote; #[cfg(feature = "runtime-benchmarks")] - type DefaultVote = pallet_collective::PrimeDefaultVote; // Overwrite with a default vote that can return `true` sometimes as it is necessary for benchmarking + type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxMembers = frame_support::pallet_prelude::ConstU32<100>; + type MaxProposalWeight = MaxWeight; + type MaxProposals = frame_support::pallet_prelude::ConstU32<20>; + type MotionDuration = TechnicalCommitteeMotionDuration; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot<AccountId>; + type WeightInfo = common_runtime::weights::pallet_collective::WeightInfo<Runtime>; } }; } diff --git a/runtime/g1/src/lib.rs b/runtime/g1/src/lib.rs index a8c6ba1c0750e0574dc65f44b7b84d906e35022f..b1a610b3e3caec792796cf60fa38f189cdf4a83b 100644 --- a/runtime/g1/src/lib.rs +++ b/runtime/g1/src/lib.rs @@ -29,37 +29,40 @@ extern crate frame_benchmarking; pub mod parameters; pub use self::parameters::*; +use common_runtime::IdtyNameValidatorImpl; pub use common_runtime::{ constants::*, entities::*, handlers::*, AccountId, Address, Balance, BlockNumber, FullIdentificationOfImpl, GetCurrentEpochIndex, Hash, Header, IdtyIndex, Index, Signature, }; -use frame_support::traits::{fungible::Balanced, Imbalance}; +use frame_support::{ + traits::{fungible::Balanced, Contains, Imbalance}, + PalletId, +}; pub use frame_system::Call as SystemCall; +use frame_system::EnsureRoot; pub use pallet_balances::Call as BalancesCall; +#[cfg(feature = "runtime-benchmarks")] +pub use pallet_collective::RawOrigin; +use pallet_grandpa::{ + fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, +}; pub use pallet_identity::{IdtyStatus, IdtyValue}; pub use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as session_historical; pub use pallet_timestamp::Call as TimestampCall; -use pallet_transaction_payment::FungibleAdapter; +use pallet_transaction_payment::{FungibleAdapter, Multiplier}; pub use pallet_universal_dividend; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use sp_runtime::{KeyTypeId, Perbill, Permill}; - -use common_runtime::IdtyNameValidatorImpl; -use frame_support::{traits::Contains, PalletId}; -use frame_system::EnsureRoot; -use pallet_grandpa::{ - fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, -}; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, One, OpaqueKeys}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; +pub use sp_runtime::{KeyTypeId, Perbill, Permill}; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -231,8 +234,10 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType { } } +#[cfg(feature = "runtime-benchmarks")] +type WorstOrigin = RawOrigin<AccountId, TechnicalCommitteeInstance>; // Configure pallets to include in runtime. -common_runtime::pallets_config! {} +common_runtime::pallets_config!(); // Create the runtime by composing the pallets that were previously configured. construct_runtime!( diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index f2955b84117d90bc6ce3b1778510de7e9f65ff0e..37b9acd9ec60727b1adf2f6595eb41771b5bee24 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -29,37 +29,40 @@ extern crate frame_benchmarking; pub mod parameters; pub use self::parameters::*; +use common_runtime::IdtyNameValidatorImpl; pub use common_runtime::{ constants::*, entities::*, handlers::*, AccountId, Address, Balance, BlockNumber, FullIdentificationOfImpl, GetCurrentEpochIndex, Hash, Header, IdtyIndex, Index, Signature, }; -use frame_support::traits::{fungible::Balanced, Imbalance}; +use frame_support::{ + traits::{fungible::Balanced, Contains, Imbalance}, + PalletId, +}; pub use frame_system::Call as SystemCall; +use frame_system::EnsureRoot; pub use pallet_balances::Call as BalancesCall; +#[cfg(feature = "runtime-benchmarks")] +pub use pallet_collective::RawOrigin; pub use pallet_duniter_test_parameters::Parameters as GenesisParameters; +use pallet_grandpa::{ + fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, +}; pub use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as session_historical; pub use pallet_timestamp::Call as TimestampCall; -use pallet_transaction_payment::FungibleAdapter; +use pallet_transaction_payment::{FungibleAdapter, Multiplier}; pub use pallet_universal_dividend; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use sp_runtime::{KeyTypeId, Perbill, Permill}; - -use common_runtime::IdtyNameValidatorImpl; -use frame_support::{traits::Contains, PalletId}; -use frame_system::EnsureRoot; -use pallet_grandpa::{ - fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, -}; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, One, OpaqueKeys}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; +pub use sp_runtime::{KeyTypeId, Perbill, Permill}; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -242,38 +245,38 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType { } } -// Configure pallets to include in runtime. -common_runtime::pallets_config! { - // Dynamic parameters - pub type EpochDuration = pallet_duniter_test_parameters::BabeEpochDuration<Runtime>; - pub type CertPeriod = pallet_duniter_test_parameters::CertPeriod<Runtime>; - pub type MaxByIssuer = pallet_duniter_test_parameters::CertMaxByIssuer<Runtime>; - pub type MinReceivedCertToBeAbleToIssueCert = - pallet_duniter_test_parameters::CertMinReceivedCertToIssueCert<Runtime>; - pub type ValidityPeriod = pallet_duniter_test_parameters::CertValidityPeriod<Runtime>; - pub type ConfirmPeriod = pallet_duniter_test_parameters::IdtyConfirmPeriod<Runtime>; - pub type IdtyCreationPeriod = pallet_duniter_test_parameters::IdtyCreationPeriod<Runtime>; - pub type MembershipPeriod = pallet_duniter_test_parameters::MembershipPeriod<Runtime>; - pub type MembershipRenewalPeriod = pallet_duniter_test_parameters::MembershipRenewalPeriod<Runtime>; - pub type UdCreationPeriod = pallet_duniter_test_parameters::UdCreationPeriod<Runtime>; - pub type UdReevalPeriod = pallet_duniter_test_parameters::UdReevalPeriod<Runtime>; - pub type WotFirstCertIssuableOn = pallet_duniter_test_parameters::WotFirstCertIssuableOn<Runtime>; - pub type WotMinCertForMembership = pallet_duniter_test_parameters::WotMinCertForMembership<Runtime>; - pub type WotMinCertForCreateIdtyRight = - pallet_duniter_test_parameters::WotMinCertForCreateIdtyRight<Runtime>; - pub type SmithMaxByIssuer = pallet_duniter_test_parameters::SmithCertMaxByIssuer<Runtime>; - pub type SmithWotMinCertForMembership = - pallet_duniter_test_parameters::SmithWotMinCertForMembership<Runtime>; - pub type SmithInactivityMaxDuration = - pallet_duniter_test_parameters::SmithInactivityMaxDuration<Runtime>; +// Dynamic parameters +pub type EpochDuration = pallet_duniter_test_parameters::BabeEpochDuration<Runtime>; +pub type CertPeriod = pallet_duniter_test_parameters::CertPeriod<Runtime>; +pub type MaxByIssuer = pallet_duniter_test_parameters::CertMaxByIssuer<Runtime>; +pub type MinReceivedCertToBeAbleToIssueCert = + pallet_duniter_test_parameters::CertMinReceivedCertToIssueCert<Runtime>; +pub type ValidityPeriod = pallet_duniter_test_parameters::CertValidityPeriod<Runtime>; +pub type ConfirmPeriod = pallet_duniter_test_parameters::IdtyConfirmPeriod<Runtime>; +pub type IdtyCreationPeriod = pallet_duniter_test_parameters::IdtyCreationPeriod<Runtime>; +pub type MembershipPeriod = pallet_duniter_test_parameters::MembershipPeriod<Runtime>; +pub type MembershipRenewalPeriod = pallet_duniter_test_parameters::MembershipRenewalPeriod<Runtime>; +pub type UdCreationPeriod = pallet_duniter_test_parameters::UdCreationPeriod<Runtime>; +pub type UdReevalPeriod = pallet_duniter_test_parameters::UdReevalPeriod<Runtime>; +pub type WotFirstCertIssuableOn = pallet_duniter_test_parameters::WotFirstCertIssuableOn<Runtime>; +pub type WotMinCertForMembership = pallet_duniter_test_parameters::WotMinCertForMembership<Runtime>; +pub type WotMinCertForCreateIdtyRight = + pallet_duniter_test_parameters::WotMinCertForCreateIdtyRight<Runtime>; +pub type SmithMaxByIssuer = pallet_duniter_test_parameters::SmithCertMaxByIssuer<Runtime>; +pub type SmithWotMinCertForMembership = + pallet_duniter_test_parameters::SmithWotMinCertForMembership<Runtime>; +pub type SmithInactivityMaxDuration = + pallet_duniter_test_parameters::SmithInactivityMaxDuration<Runtime>; - impl pallet_duniter_test_parameters::Config for Runtime { - type BlockNumber = u32; - type CertCount = u32; - type PeriodCount = Balance; - type SessionCount = u32; - } +impl pallet_duniter_test_parameters::Config for Runtime { + type BlockNumber = u32; + type CertCount = u32; + type PeriodCount = Balance; + type SessionCount = u32; } +#[cfg(feature = "runtime-benchmarks")] +type WorstOrigin = RawOrigin<AccountId, TechnicalCommitteeInstance>; +common_runtime::pallets_config!(); // Create the runtime by composing the pallets that were previously configured. construct_runtime!( diff --git a/runtime/gtest/src/lib.rs b/runtime/gtest/src/lib.rs index 5d35e67fbc003f4bd6bfa7e3e1c19ac23da9e2d0..124c8b74380ad1fb4491e5fc14bf09214c9abf9d 100644 --- a/runtime/gtest/src/lib.rs +++ b/runtime/gtest/src/lib.rs @@ -29,36 +29,39 @@ extern crate frame_benchmarking; pub mod parameters; pub use self::parameters::*; +use common_runtime::IdtyNameValidatorImpl; pub use common_runtime::{ constants::*, entities::*, handlers::*, AccountId, Address, Balance, BlockNumber, FullIdentificationOfImpl, GetCurrentEpochIndex, Hash, Header, IdtyIndex, Index, Signature, }; -use frame_support::traits::{fungible::Balanced, Imbalance}; +use frame_support::{ + traits::{fungible::Balanced, Contains, Imbalance}, + PalletId, +}; pub use frame_system::Call as SystemCall; +use frame_system::EnsureRoot; pub use pallet_balances::Call as BalancesCall; +#[cfg(feature = "runtime-benchmarks")] +pub use pallet_collective::RawOrigin; +use pallet_grandpa::{ + fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, +}; pub use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as session_historical; pub use pallet_timestamp::Call as TimestampCall; -use pallet_transaction_payment::FungibleAdapter; +use pallet_transaction_payment::{FungibleAdapter, Multiplier}; pub use pallet_universal_dividend; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use sp_runtime::{KeyTypeId, Perbill, Permill}; - -use common_runtime::IdtyNameValidatorImpl; -use frame_support::{traits::Contains, PalletId}; -use frame_system::EnsureRoot; -use pallet_grandpa::{ - fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, -}; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, One, OpaqueKeys}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; +pub use sp_runtime::{KeyTypeId, Perbill, Permill}; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -237,7 +240,9 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType { } // Configure pallets to include in runtime. -common_runtime::pallets_config! {} +#[cfg(feature = "runtime-benchmarks")] +type WorstOrigin = RawOrigin<AccountId, TechnicalCommitteeInstance>; +common_runtime::pallets_config!(); // Create the runtime by composing the pallets that were previously configured. construct_runtime!( diff --git a/rustfmt.toml b/rustfmt.toml index f2abd12533cc86c456bcebc3989330f39983ef2a..793ece8dbcdab0bd62adbc1a5e5b9f4100d1fce2 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,2 +1,3 @@ imports_granularity = "Crate" reorder_impl_items = true +error_on_unformatted = true