From 5f21be981858cfcc2fd72cb2176858a5a789f2fb Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Thu, 16 Jan 2025 09:56:27 +0000 Subject: [PATCH 1/2] update spend origin --- runtime/moonbase/src/lib.rs | 10 ++++------ runtime/moonbeam/src/lib.rs | 10 ++++------ runtime/moonriver/src/lib.rs | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 5ea72b82ed..ae7794b602 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -595,9 +595,10 @@ parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); pub const TreasuryId: PalletId = PalletId(*b"pc/trsry"); pub TreasuryAccount: AccountId = Treasury::account_id(); + pub const MaxSpendBalance: crate::Balance = crate::Balance::max_value(); } -type TreasuryRejectOrigin = EitherOfDiverse< +type RootOrTreasuryCouncilOrigin = EitherOfDiverse< EnsureRoot, pallet_collective::EnsureProportionMoreThan, >; @@ -606,7 +607,7 @@ impl pallet_treasury::Config for Runtime { type PalletId = TreasuryId; type Currency = Balances; // More than half of the council is required (or root) to reject a proposal - type RejectOrigin = TreasuryRejectOrigin; + type RejectOrigin = RootOrTreasuryCouncilOrigin; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU32<{ 6 * DAYS }>; type Burn = (); @@ -614,11 +615,8 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = ConstU32<100>; type WeightInfo = moonbase_weights::pallet_treasury::WeightInfo; type SpendFunds = (); - #[cfg(not(feature = "runtime-benchmarks"))] - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; // Disabled, no spending - #[cfg(feature = "runtime-benchmarks")] type SpendOrigin = - frame_system::EnsureWithSuccess, AccountId, benches::MaxBalance>; + frame_system::EnsureWithSuccess; type AssetKind = (); type Beneficiary = AccountId; type BeneficiaryLookup = IdentityLookup; diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 5d2cbe8330..83d9b9eea9 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -585,9 +585,10 @@ parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); pub const TreasuryId: PalletId = PalletId(*b"py/trsry"); pub TreasuryAccount: AccountId = Treasury::account_id(); + pub const MaxSpendBalance: crate::Balance = crate::Balance::max_value(); } -type TreasuryRejectOrigin = EitherOfDiverse< +type RootOrTreasuryCouncilOrigin = EitherOfDiverse< EnsureRoot, pallet_collective::EnsureProportionMoreThan, >; @@ -596,7 +597,7 @@ impl pallet_treasury::Config for Runtime { type PalletId = TreasuryId; type Currency = Balances; // More than half of the council is required (or root) to reject a proposal - type RejectOrigin = TreasuryRejectOrigin; + type RejectOrigin = RootOrTreasuryCouncilOrigin; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU32<{ 6 * DAYS }>; type Burn = (); @@ -604,11 +605,8 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = ConstU32<100>; type WeightInfo = moonbeam_weights::pallet_treasury::WeightInfo; type SpendFunds = (); - #[cfg(not(feature = "runtime-benchmarks"))] - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; // Disabled, no spending - #[cfg(feature = "runtime-benchmarks")] type SpendOrigin = - frame_system::EnsureWithSuccess, AccountId, benches::MaxBalance>; + frame_system::EnsureWithSuccess; type AssetKind = (); type Beneficiary = AccountId; type BeneficiaryLookup = IdentityLookup; diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 5fc1def9d3..9303c40673 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -587,9 +587,10 @@ parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); pub const TreasuryId: PalletId = PalletId(*b"py/trsry"); pub TreasuryAccount: AccountId = Treasury::account_id(); + pub const MaxSpendBalance: crate::Balance = crate::Balance::max_value(); } -type TreasuryRejectOrigin = EitherOfDiverse< +type RootOrTreasuryCouncilOrigin = EitherOfDiverse< EnsureRoot, pallet_collective::EnsureProportionMoreThan, >; @@ -598,7 +599,7 @@ impl pallet_treasury::Config for Runtime { type PalletId = TreasuryId; type Currency = Balances; // More than half of the council is required (or root) to reject a proposal - type RejectOrigin = TreasuryRejectOrigin; + type RejectOrigin = RootOrTreasuryCouncilOrigin; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU32<{ 6 * DAYS }>; type Burn = (); @@ -606,11 +607,8 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = ConstU32<100>; type WeightInfo = moonriver_weights::pallet_treasury::WeightInfo; type SpendFunds = (); - #[cfg(not(feature = "runtime-benchmarks"))] - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; // Disabled, no spending - #[cfg(feature = "runtime-benchmarks")] type SpendOrigin = - frame_system::EnsureWithSuccess, AccountId, benches::MaxBalance>; + frame_system::EnsureWithSuccess; type AssetKind = (); type Beneficiary = AccountId; type BeneficiaryLookup = IdentityLookup; From 07b8f0d179549f9be5e96ff36865406a079caff8 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:35:28 +0000 Subject: [PATCH 2/2] update spec version to 3401 (#3133) --- runtime/moonbase/src/lib.rs | 2 +- runtime/moonbeam/src/lib.rs | 2 +- runtime/moonriver/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 5ea72b82ed..9c9dc28e1c 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -195,7 +195,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("moonbase"), impl_name: create_runtime_str!("moonbase"), authoring_version: 4, - spec_version: 3400, + spec_version: 3401, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 5d2cbe8330..5b63f4b17f 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -193,7 +193,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("moonbeam"), impl_name: create_runtime_str!("moonbeam"), authoring_version: 3, - spec_version: 3400, + spec_version: 3401, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 5fc1def9d3..d908b91671 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -195,7 +195,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("moonriver"), impl_name: create_runtime_str!("moonriver"), authoring_version: 3, - spec_version: 3400, + spec_version: 3401, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3,