Council as SpendOrigin (#6877)

This commit is contained in:
Muharem Ismailov
2023-03-15 10:39:20 +01:00
committed by GitHub
parent ba29d06334
commit 16f3bd48b3
+11 -3
View File
@@ -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;
@@ -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<
@@ -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! {