Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add submitorigin to democracy
  • Loading branch information
Daniel Shiposha committed Feb 17, 2023
commit fc28aac4e07bcd1eb3f66b88c753408d9996fa73
1 change: 1 addition & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ impl pallet_democracy::Config for Runtime {
/// (NTB) vote.
type ExternalDefaultOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
type SubmitOrigin = EnsureSigned<AccountId>;
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin =
Expand Down
6 changes: 5 additions & 1 deletion frame/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ pub mod pallet {
/// of a negative-turnout-bias (default-carries) referendum.
type ExternalDefaultOrigin: EnsureOrigin<Self::RuntimeOrigin>;

/// Origin from which the new proposal can be made.
/// The Success is the account id of the depositor.
type SubmitOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;

/// Origin from which the next majority-carries (or more permissive) referendum may be
/// tabled to vote according to the `FastTrackVotingPeriod` asynchronously in a similar
/// manner to the emergency origin. It retains its threshold method.
Expand Down Expand Up @@ -590,7 +594,7 @@ pub mod pallet {
proposal: BoundedCallOf<T>,
#[pallet::compact] value: BalanceOf<T>,
) -> DispatchResult {
let who = ensure_signed(origin)?;
let who = T::SubmitOrigin::ensure_origin(origin)?;
ensure!(value >= T::MinimumDeposit::get(), Error::<T>::ValueLow);

let index = Self::public_prop_count();
Expand Down