Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Polkadot: add Council to SpendOrigin #6877

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ use frame_election_provider_support::{generate_solution_type, onchain, Sequentia
use frame_support::{
construct_runtime, parameter_types,
traits::{
ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
ConstU32, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
PrivilegeCmp, WithdrawReasons,
},
weights::ConstantMultiplier,
PalletId, RuntimeDebug,
};
use frame_system::EnsureRoot;
use frame_system::{EnsureRoot, EnsureWithSuccess};
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_session::historical as session_historical;
Expand Down Expand Up @@ -826,6 +826,7 @@ parameter_types! {
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
pub const RootSpendOriginMaxAmount: Balance = Balance::MAX;
pub const CouncilSpendOriginMaxAmount: Balance = Balance::MAX;
}

type ApproveOrigin = EitherOfDiverse<
Expand All @@ -849,7 +850,14 @@ impl pallet_treasury::Config for Runtime {
type SpendFunds = Bounties;
type MaxApprovals = MaxApprovals;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
type SpendOrigin = frame_system::EnsureRootWithSuccess<AccountId, RootSpendOriginMaxAmount>;
type SpendOrigin = EitherOf<
frame_system::EnsureRootWithSuccess<AccountId, RootSpendOriginMaxAmount>,
EnsureWithSuccess<
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 5>,
AccountId,
CouncilSpendOriginMaxAmount,
>,
>;
}

parameter_types! {
Expand Down