Companion for Remove u32_trait (#4920)

* Companion for `Remove u32_trait`

* update lockfile for {"substrate"}

* FMT

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2022-02-14 22:56:35 +01:00
committed by GitHub
parent 71c1388290
commit 217d5275c4
3 changed files with 193 additions and 197 deletions
+163 -163
View File
File diff suppressed because it is too large Load Diff
+15 -16
View File
@@ -37,7 +37,6 @@ use runtime_common::{
BlockHashCount, BlockLength, BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit, BlockHashCount, BlockLength, BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit,
OffchainSolutionWeightLimit, RocksDbWeight, SlowAdjustingFeeUpdate, OffchainSolutionWeightLimit, RocksDbWeight, SlowAdjustingFeeUpdate,
}; };
use sp_core::u32_trait::{_1, _2, _3, _5};
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
use runtime_parachains::{ use runtime_parachains::{
@@ -148,7 +147,7 @@ impl Contains<Call> for BaseFilter {
type MoreThanHalfCouncil = EnsureOneOf< type MoreThanHalfCouncil = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>; >;
parameter_types! { parameter_types! {
@@ -192,7 +191,7 @@ parameter_types! {
type ScheduleOrigin = EnsureOneOf< type ScheduleOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
>; >;
/// Used the compare the privilege of an origin inside the scheduler. /// Used the compare the privilege of an origin inside the scheduler.
@@ -459,7 +458,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf< type ForceOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>; >;
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Self>; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Self>;
type VoterSnapshotPerBlock = VoterSnapshotPerBlock; type VoterSnapshotPerBlock = VoterSnapshotPerBlock;
@@ -553,7 +552,7 @@ parameter_types! {
type SlashCancelOrigin = EnsureOneOf< type SlashCancelOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
>; >;
impl frame_election_provider_support::onchain::Config for Runtime { impl frame_election_provider_support::onchain::Config for Runtime {
@@ -610,33 +609,33 @@ impl pallet_democracy::Config for Runtime {
type MinimumDeposit = MinimumDeposit; type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is. /// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = type ExternalOrigin =
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
/// A majority can have the next scheduled referendum be a straight majority-carries vote. /// A majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin = type ExternalMajorityOrigin =
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries /// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote. /// (NTB) vote.
type ExternalDefaultOrigin = type ExternalDefaultOrigin =
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
/// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote /// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote
/// be tabled immediately and with a shorter voting/enactment period. /// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = type FastTrackOrigin =
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
type InstantOrigin = type InstantOrigin =
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>;
type InstantAllowed = InstantAllowed; type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod; type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it. // To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = EnsureOneOf< type CancellationOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>; >;
type BlacklistOrigin = EnsureRoot<AccountId>; type BlacklistOrigin = EnsureRoot<AccountId>;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or // To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree. // Root must agree.
type CancelProposalOrigin = EnsureOneOf< type CancelProposalOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
>; >;
// Any single technical committee member may veto a coming council proposal, however they can // Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cooloff period. // only do it once and it lasts only for the cooloff period.
@@ -762,7 +761,7 @@ parameter_types! {
type ApproveOrigin = EnsureOneOf< type ApproveOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 5>,
>; >;
impl pallet_treasury::Config for Runtime { impl pallet_treasury::Config for Runtime {
@@ -930,7 +929,7 @@ impl claims::Config for Runtime {
type VestingSchedule = Vesting; type VestingSchedule = Vesting;
type Prefix = Prefix; type Prefix = Prefix;
type MoveClaimOrigin = type MoveClaimOrigin =
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type WeightInfo = weights::runtime_common_claims::WeightInfo<Runtime>; type WeightInfo = weights::runtime_common_claims::WeightInfo<Runtime>;
} }
@@ -1025,7 +1024,7 @@ impl pallet_society::Config for Runtime {
type RotationPeriod = RotationPeriod; type RotationPeriod = RotationPeriod;
type MaxLockDuration = MaxLockDuration; type MaxLockDuration = MaxLockDuration;
type FounderSetOrigin = type FounderSetOrigin =
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type SuspensionJudgementOrigin = pallet_society::EnsureFounder<Runtime>; type SuspensionJudgementOrigin = pallet_society::EnsureFounder<Runtime>;
type ChallengePeriod = ChallengePeriod; type ChallengePeriod = ChallengePeriod;
type MaxCandidateIntake = MaxCandidateIntake; type MaxCandidateIntake = MaxCandidateIntake;
@@ -1319,7 +1318,7 @@ parameter_types! {
type AuctionInitiate = EnsureOneOf< type AuctionInitiate = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>; >;
impl auctions::Config for Runtime { impl auctions::Config for Runtime {
+15 -18
View File
@@ -64,10 +64,7 @@ use primitives::{
}, },
v2::SessionInfo, v2::SessionInfo,
}; };
use sp_core::{ use sp_core::OpaqueMetadata;
u32_trait::{_1, _2, _3, _4, _5},
OpaqueMetadata,
};
use sp_runtime::{ use sp_runtime::{
create_runtime_str, create_runtime_str,
curve::PiecewiseLinear, curve::PiecewiseLinear,
@@ -192,7 +189,7 @@ impl Contains<Call> for BaseFilter {
type MoreThanHalfCouncil = EnsureOneOf< type MoreThanHalfCouncil = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>; >;
parameter_types! { parameter_types! {
@@ -236,7 +233,7 @@ parameter_types! {
type ScheduleOrigin = EnsureOneOf< type ScheduleOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
>; >;
/// Used the compare the privilege of an origin inside the scheduler. /// Used the compare the privilege of an origin inside the scheduler.
@@ -501,7 +498,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf< type ForceOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>; >;
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Self>; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Self>;
type VoterSnapshotPerBlock = VoterSnapshotPerBlock; type VoterSnapshotPerBlock = VoterSnapshotPerBlock;
@@ -549,7 +546,7 @@ parameter_types! {
type SlashCancelOrigin = EnsureOneOf< type SlashCancelOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>,
>; >;
impl frame_election_provider_support::onchain::Config for Runtime { impl frame_election_provider_support::onchain::Config for Runtime {
@@ -631,41 +628,41 @@ impl pallet_democracy::Config for Runtime {
type MinimumDeposit = MinimumDeposit; type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is. /// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = EnsureOneOf< type ExternalOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
frame_system::EnsureRoot<AccountId>, frame_system::EnsureRoot<AccountId>,
>; >;
/// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. /// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin = EnsureOneOf< type ExternalMajorityOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 5>,
frame_system::EnsureRoot<AccountId>, frame_system::EnsureRoot<AccountId>,
>; >;
/// A unanimous council can have the next scheduled referendum be a straight default-carries /// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote. /// (NTB) vote.
type ExternalDefaultOrigin = EnsureOneOf< type ExternalDefaultOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>,
frame_system::EnsureRoot<AccountId>, frame_system::EnsureRoot<AccountId>,
>; >;
/// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote /// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote
/// be tabled immediately and with a shorter voting/enactment period. /// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = EnsureOneOf< type FastTrackOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>,
frame_system::EnsureRoot<AccountId>, frame_system::EnsureRoot<AccountId>,
>; >;
type InstantOrigin = EnsureOneOf< type InstantOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
frame_system::EnsureRoot<AccountId>, frame_system::EnsureRoot<AccountId>,
>; >;
type InstantAllowed = InstantAllowed; type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod; type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it. // To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = EnsureOneOf< type CancellationOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
>; >;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or // To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree. // Root must agree.
type CancelProposalOrigin = EnsureOneOf< type CancelProposalOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
>; >;
type BlacklistOrigin = EnsureRoot<AccountId>; type BlacklistOrigin = EnsureRoot<AccountId>;
@@ -793,7 +790,7 @@ parameter_types! {
type ApproveOrigin = EnsureOneOf< type ApproveOrigin = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 5>,
>; >;
impl pallet_treasury::Config for Runtime { impl pallet_treasury::Config for Runtime {
@@ -968,7 +965,7 @@ impl claims::Config for Runtime {
type Prefix = Prefix; type Prefix = Prefix;
/// At least 3/4 of the council must agree to a claim move before it can happen. /// At least 3/4 of the council must agree to a claim move before it can happen.
type MoveClaimOrigin = type MoveClaimOrigin =
pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>;
type WeightInfo = weights::runtime_common_claims::WeightInfo<Runtime>; type WeightInfo = weights::runtime_common_claims::WeightInfo<Runtime>;
} }
@@ -1308,7 +1305,7 @@ parameter_types! {
type AuctionInitiate = EnsureOneOf< type AuctionInitiate = EnsureOneOf<
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>,
>; >;
impl auctions::Config for Runtime { impl auctions::Config for Runtime {