Skip to content

Commit

Permalink
cancel and kill origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Apr 28, 2024
1 parent 250a6af commit b52b86a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions runtime/regionx/src/governance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ pub type GeneralCouncilInstance = pallet_collective::Instance2;
pub type GeneralCouncilMembershipInstance = pallet_membership::Instance1;
pub type TechnicalCommitteeMembershipInstance = pallet_membership::Instance2;

type EnsureTwoThirdGeneralCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilInstance, 2, 3>;
type EnsureTwoThirdTechnicalCommittee =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>;

parameter_types! {
pub const VoteLockingPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1);
}
Expand Down Expand Up @@ -58,8 +63,10 @@ impl pallet_referenda::Config for Runtime {
type Scheduler = Scheduler;
type Currency = RelayChainCurrency;
type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
type CancelOrigin = EnsureRoot<AccountId>; // TODO: Or Technical fellowship
type KillOrigin = EnsureRoot<AccountId>; // TODO: Or Technical fellowship
type CancelOrigin =
EitherOfDiverse<EnsureTwoThirdTechnicalCommittee, EnsureTwoThirdGeneralCouncil>;
type KillOrigin =
EitherOfDiverse<EnsureTwoThirdTechnicalCommittee, EnsureTwoThirdGeneralCouncil>;
type Slash = (); // TODO: treasury
type Votes = pallet_conviction_voting::VotesOf<Runtime>;
type Tally = pallet_conviction_voting::TallyOf<Runtime>;
Expand All @@ -78,11 +85,6 @@ parameter_types! {
pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block;
}

type EnsureTwoThirdGeneralCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilInstance, 2, 3>;
type EnsureTwoThirdTechnicalCommittee =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>;

impl pallet_collective::Config<GeneralCouncilInstance> for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Proposal = RuntimeCall;
Expand Down
6 changes: 3 additions & 3 deletions runtime/regionx/src/governance/origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub use pallet_custom_origins::*;
#[allow(unused_imports)]
#[frame_support::pallet]
pub mod pallet_custom_origins {
use crate::{Balance, REGX};
use crate::{Balance, REGX};
use frame_support::pallet_prelude::*;

#[pallet::config]
Expand All @@ -18,7 +18,7 @@ pub mod pallet_custom_origins {
pub enum Origin {
/// Origin able to dispatch a whitelisted call.
WhitelistedCaller,
/// Origin able to spend up to 500 REGX from the treasury at once.
/// Origin able to spend up to 500 REGX from the treasury at once.
SmallTipper,
/// Origin able to spend up to 2,000 REGX from the treasury at once.
BigTipper,
Expand Down Expand Up @@ -62,7 +62,7 @@ pub mod pallet_custom_origins {
}
decl_unit_ensures!(WhitelistedCaller);

macro_rules! decl_ensure {
macro_rules! decl_ensure {
(
$vis:vis type $name:ident: EnsureOrigin<Success = $success_type:ty> {
$( $item:ident = $success:expr, )*
Expand Down

0 comments on commit b52b86a

Please sign in to comment.