Skip to content

Commit

Permalink
fix: 🐛 treasury SpendOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
yooml committed Oct 30, 2023
1 parent 3638e11 commit 65cbe5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use frame_support::{
construct_runtime, match_types, parameter_types,
traits::{
ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, Everything,
InstanceFilter, IsInVec, NeverEnsureOrigin, Nothing, Randomness,
InstanceFilter, IsInVec, Nothing, Randomness,
},
weights::{
constants::{
Expand Down Expand Up @@ -84,7 +84,7 @@ use frame_support::{
sp_runtime::traits::{Convert, ConvertInto},
traits::{Currency, EitherOfDiverse, Get, Imbalance, LockIdentifier, OnUnbalanced},
};
use frame_system::{EnsureRoot, EnsureSigned};
use frame_system::{EnsureRoot, EnsureSigned, EnsureWithSuccess};
use hex_literal::hex;
pub use node_primitives::{
traits::{
Expand Down Expand Up @@ -831,6 +831,7 @@ parameter_types! {
pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50);
pub CuratorDepositMin: Balance = 1 * BNCS;
pub CuratorDepositMax: Balance = 100 * BNCS;
pub const MaxBalance: Balance = 800_000 * BNCS;
}

type ApproveOrigin = EitherOfDiverse<
Expand All @@ -840,7 +841,7 @@ type ApproveOrigin = EitherOfDiverse<

impl pallet_treasury::Config for Runtime {
type ApproveOrigin = ApproveOrigin;
type SpendOrigin = NeverEnsureOrigin<Balance>;
type SpendOrigin = EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, MaxBalance>;
type Burn = Burn;
type BurnDestination = ();
type Currency = Balances;
Expand Down
8 changes: 4 additions & 4 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ pub use frame_support::{
match_types, parameter_types,
traits::{
ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, Everything,
Imbalance, InstanceFilter, IsInVec, LockIdentifier, NeverEnsureOrigin, Nothing,
OnUnbalanced, Randomness,
Imbalance, InstanceFilter, IsInVec, LockIdentifier, Nothing, OnUnbalanced, Randomness,
},
weights::{
constants::{
Expand Down Expand Up @@ -85,7 +84,7 @@ use frame_support::{
sp_runtime::traits::{Convert, ConvertInto},
traits::{Currency, EitherOfDiverse, Get},
};
use frame_system::{EnsureRoot, EnsureSigned};
use frame_system::{EnsureRoot, EnsureSigned, EnsureWithSuccess};
use hex_literal::hex;
pub use node_primitives::{
traits::{
Expand Down Expand Up @@ -791,6 +790,7 @@ parameter_types! {
pub const TipReportDepositBase: Balance = 1 * DOLLARS;
pub const DataDepositPerByte: Balance = 1 * CENTS;
pub const MaxApprovals: u32 = 100;
pub const MaxBalance: Balance = 800_000 * BNCS;
}

type ApproveOrigin = EitherOfDiverse<
Expand All @@ -800,7 +800,7 @@ type ApproveOrigin = EitherOfDiverse<

impl pallet_treasury::Config for Runtime {
type ApproveOrigin = ApproveOrigin;
type SpendOrigin = NeverEnsureOrigin<Balance>;
type SpendOrigin = EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, MaxBalance>;
type Burn = Burn;
type BurnDestination = ();
type Currency = Balances;
Expand Down

0 comments on commit 65cbe5b

Please sign in to comment.