Skip to content

Commit

Permalink
fix: EnsureOneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Feb 1, 2022
1 parent 4130db3 commit c76d7ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions runtimes/peregrine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

use frame_support::{
construct_runtime, parameter_types,
traits::{EnsureOneOf, EqualPrivilegeOnly, OnRuntimeUpgrade},
traits::{EnsureOneOf, EqualPrivilegeOnly, OnRuntimeUpgrade, PrivilegeCmp},
weights::{constants::RocksDbWeight, Weight},
};
use frame_system::EnsureRoot;
Expand Down Expand Up @@ -212,7 +212,7 @@ parameter_types! {

impl cumulus_pallet_parachain_system::Config for Runtime {
type Event = Event;
type OnValidationData = ();
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type OutboundXcmpMessageSource = ();
type DmpMessageHandler = ();
Expand Down Expand Up @@ -292,7 +292,6 @@ parameter_types! {
pub const PreimageMaxSize: u32 = 4096 * 1024;
// FIXME: Handle together with other deposits
pub const PreimageBaseDeposit: Balance = KILT;
pub const PreimageByteDeposit: Balance = KILT;
}

impl pallet_preimage::Config for Runtime {
Expand Down Expand Up @@ -394,14 +393,12 @@ impl pallet_democracy::Config for Runtime {
// To cancel a proposal which has been passed, 2/3 of the council must agree to
// it.
type CancellationOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
>;
// To cancel a proposal before it has been passed, the technical committee must
// be unanimous or Root must agree.
type CancelProposalOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
>;
Expand Down Expand Up @@ -430,13 +427,11 @@ parameter_types! {
}

type ApproveOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
>;

type MoreThanHalfCouncil = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>,
>;
Expand Down
9 changes: 2 additions & 7 deletions runtimes/spiritnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

use frame_support::{
construct_runtime, parameter_types,
traits::{Contains, EnsureOneOf, OnRuntimeUpgrade},
traits::{Contains, EnsureOneOf, OnRuntimeUpgrade, PrivilegeCmp},
weights::{constants::RocksDbWeight, Weight},
};
use frame_system::EnsureRoot;
Expand Down Expand Up @@ -217,7 +217,7 @@ parameter_types! {

impl cumulus_pallet_parachain_system::Config for Runtime {
type Event = Event;
type OnValidationData = ();
type OnSystemEvent = ();
type SelfParaId = parachain_info::Pallet<Runtime>;
type OutboundXcmpMessageSource = ();
type DmpMessageHandler = ();
Expand Down Expand Up @@ -297,7 +297,6 @@ parameter_types! {
pub const PreimageMaxSize: u32 = 4096 * 1024;
// FIXME: Handle together with other deposits
pub const PreimageBaseDeposit: Balance = KILT;
pub const PreimageByteDeposit: Balance = KILT;
}

impl pallet_preimage::Config for Runtime {
Expand Down Expand Up @@ -399,14 +398,12 @@ impl pallet_democracy::Config for Runtime {
// To cancel a proposal which has been passed, 2/3 of the council must agree to
// it.
type CancellationOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
>;
// To cancel a proposal before it has been passed, the technical committee must
// be unanimous or Root must agree.
type CancelProposalOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
>;
Expand Down Expand Up @@ -435,13 +432,11 @@ parameter_types! {
}

type ApproveOrigin = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
>;

type MoreThanHalfCouncil = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>,
>;
Expand Down

0 comments on commit c76d7ca

Please sign in to comment.