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

Commit

Permalink
Council as SpendOrigin (#6877)
Browse files Browse the repository at this point in the history
  • Loading branch information
muharem authored Mar 15, 2023
1 parent 5434628 commit 0ff5ee8
Showing 1 changed file with 11 additions and 3 deletions.
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

0 comments on commit 0ff5ee8

Please sign in to comment.