This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow voting in democracy #1331
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,12 @@ pub struct BaseFilter; | |
impl Filter<Call> for BaseFilter { | ||
fn filter(call: &Call) -> bool { | ||
match call { | ||
Call::Parachains(parachains::Call::set_heads(..)) => true, | ||
Call::Parachains(parachains::Call::set_heads(..)) | ||
| Call::Democracy(democracy::Call::vote(..)) | ||
| Call::Democracy(democracy::Call::remove_vote(..)) | ||
| Call::Democracy(democracy::Call::delegate(..)) | ||
| Call::Democracy(democracy::Call::undelegate(..)) | ||
=> true, | ||
|
||
// Governance stuff | ||
Call::Democracy(_) | Call::Council(_) | Call::TechnicalCommittee(_) | | ||
|
@@ -394,20 +399,38 @@ impl democracy::Trait for Runtime { | |
type VotingPeriod = VotingPeriod; | ||
type MinimumDeposit = MinimumDeposit; | ||
/// A straight majority of the council can decide what their next motion is. | ||
type ExternalOrigin = collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; | ||
type ExternalOrigin = system::EnsureOneOf<AccountId, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dumb question, but would this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no - it's an overhang from rust's less-than-ideal type inference; we need to provide it explicitly, but it's not one of the origins. |
||
collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, | ||
system::EnsureRoot<AccountId>, | ||
>; | ||
/// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. | ||
type ExternalMajorityOrigin = collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>; | ||
type ExternalMajorityOrigin = system::EnsureOneOf<AccountId, | ||
collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, | ||
system::EnsureRoot<AccountId>, | ||
>; | ||
/// A unanimous council can have the next scheduled referendum be a straight default-carries | ||
/// (NTB) vote. | ||
type ExternalDefaultOrigin = collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; | ||
type ExternalDefaultOrigin = system::EnsureOneOf<AccountId, | ||
collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>, | ||
system::EnsureRoot<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 = collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; | ||
type InstantOrigin = collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; | ||
type FastTrackOrigin = system::EnsureOneOf<AccountId, | ||
collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>, | ||
system::EnsureRoot<AccountId>, | ||
>; | ||
type InstantOrigin = system::EnsureOneOf<AccountId, | ||
collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, | ||
system::EnsureRoot<AccountId>, | ||
>; | ||
type InstantAllowed = InstantAllowed; | ||
type FastTrackVotingPeriod = FastTrackVotingPeriod; | ||
// To cancel a proposal which has been passed, 2/3 of the council must agree to it. | ||
type CancellationOrigin = collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; | ||
type CancellationOrigin = system::EnsureOneOf<AccountId, | ||
collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, | ||
system::EnsureRoot<AccountId>, | ||
>; | ||
// Any single technical committee member may veto a coming council proposal, however they can | ||
// only do it once and it lasts only for the cooloff period. | ||
type VetoOrigin = collective::EnsureMember<AccountId, TechnicalCollective>; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move the allowed calls from the bottom to the top here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't gain much as there's usage of defaults for selection happening both ways (e.g.
Call::Vesting(vesting::Call::vested_transfer(..)) | Call::Indices(indices::Call::transfer(..))
)