Skip to content

Commit

Permalink
update spend origin (#3132)
Browse files Browse the repository at this point in the history
* update spend origin
  • Loading branch information
RomarQ authored Jan 20, 2025
1 parent 77c99af commit 7e79a54
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 4 additions & 6 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, TreasuryCouncilInstance, 1, 2>,
>;
Expand All @@ -606,19 +607,16 @@ 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 = ();
type BurnDestination = ();
type MaxApprovals = ConstU32<100>;
type WeightInfo = moonbase_weights::pallet_treasury::WeightInfo<Runtime>;
type SpendFunds = ();
#[cfg(not(feature = "runtime-benchmarks"))]
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>; // Disabled, no spending
#[cfg(feature = "runtime-benchmarks")]
type SpendOrigin =
frame_system::EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, benches::MaxBalance>;
frame_system::EnsureWithSuccess<RootOrTreasuryCouncilOrigin, AccountId, MaxSpendBalance>;
type AssetKind = ();
type Beneficiary = AccountId;
type BeneficiaryLookup = IdentityLookup<AccountId>;
Expand Down
10 changes: 4 additions & 6 deletions runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, TreasuryCouncilInstance, 1, 2>,
>;
Expand All @@ -596,19 +597,16 @@ 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 = ();
type BurnDestination = ();
type MaxApprovals = ConstU32<100>;
type WeightInfo = moonbeam_weights::pallet_treasury::WeightInfo<Runtime>;
type SpendFunds = ();
#[cfg(not(feature = "runtime-benchmarks"))]
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>; // Disabled, no spending
#[cfg(feature = "runtime-benchmarks")]
type SpendOrigin =
frame_system::EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, benches::MaxBalance>;
frame_system::EnsureWithSuccess<RootOrTreasuryCouncilOrigin, AccountId, MaxSpendBalance>;
type AssetKind = ();
type Beneficiary = AccountId;
type BeneficiaryLookup = IdentityLookup<AccountId>;
Expand Down
10 changes: 4 additions & 6 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, TreasuryCouncilInstance, 1, 2>,
>;
Expand All @@ -598,19 +599,16 @@ 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 = ();
type BurnDestination = ();
type MaxApprovals = ConstU32<100>;
type WeightInfo = moonriver_weights::pallet_treasury::WeightInfo<Runtime>;
type SpendFunds = ();
#[cfg(not(feature = "runtime-benchmarks"))]
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>; // Disabled, no spending
#[cfg(feature = "runtime-benchmarks")]
type SpendOrigin =
frame_system::EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, benches::MaxBalance>;
frame_system::EnsureWithSuccess<RootOrTreasuryCouncilOrigin, AccountId, MaxSpendBalance>;
type AssetKind = ();
type Beneficiary = AccountId;
type BeneficiaryLookup = IdentityLookup<AccountId>;
Expand Down

0 comments on commit 7e79a54

Please sign in to comment.