From 618ced8addb490fb2987836faf93f562805b8ed5 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 2 Jan 2023 13:44:40 +0100 Subject: [PATCH 1/2] Enable treasury.spend by Root origin --- runtime/polkadot/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 8c4d85afb67d..967a81c6cc97 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -856,7 +856,7 @@ impl pallet_treasury::Config for Runtime { type SpendFunds = Bounties; type MaxApprovals = MaxApprovals; type WeightInfo = weights::pallet_treasury::WeightInfo; - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; + type SpendOrigin = EnsureRoot; } parameter_types! { From 504717df051f61bb66cd375f8b99dd5eb3f82ae9 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 2 Jan 2023 17:25:01 +0100 Subject: [PATCH 2/2] EnsureRoot -> EnsureRootWithSuccess --- runtime/polkadot/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 967a81c6cc97..b7668558f871 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -833,6 +833,7 @@ parameter_types! { pub const MaxKeys: u32 = 10_000; pub const MaxPeerInHeartbeats: u32 = 10_000; pub const MaxPeerDataEncodingSize: u32 = 1_000; + pub const RootSpendOriginMaxAmount: Balance = Balance::MAX; } type ApproveOrigin = EitherOfDiverse< @@ -856,7 +857,7 @@ impl pallet_treasury::Config for Runtime { type SpendFunds = Bounties; type MaxApprovals = MaxApprovals; type WeightInfo = weights::pallet_treasury::WeightInfo; - type SpendOrigin = EnsureRoot; + type SpendOrigin = frame_system::EnsureRootWithSuccess; } parameter_types! {