Trait pallet_democracy::pallet::Config
source · pub trait Config: Config + Sized {
Show 28 associated items
type Proposal: Parameter + Dispatchable<Origin = Self::Origin> + From<Call<Self>>;
type Event: From<Event<Self>> + IsType<<Self as Config>::Event>;
type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber>;
type EnactmentPeriod: Get<Self::BlockNumber>;
type LaunchPeriod: Get<Self::BlockNumber>;
type VotingPeriod: Get<Self::BlockNumber>;
type VoteLockingPeriod: Get<Self::BlockNumber>;
type MinimumDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
type ExternalOrigin: EnsureOrigin<Self::Origin>;
type ExternalMajorityOrigin: EnsureOrigin<Self::Origin>;
type ExternalDefaultOrigin: EnsureOrigin<Self::Origin>;
type FastTrackOrigin: EnsureOrigin<Self::Origin>;
type InstantOrigin: EnsureOrigin<Self::Origin>;
type InstantAllowed: Get<bool>;
type FastTrackVotingPeriod: Get<Self::BlockNumber>;
type CancellationOrigin: EnsureOrigin<Self::Origin>;
type BlacklistOrigin: EnsureOrigin<Self::Origin>;
type CancelProposalOrigin: EnsureOrigin<Self::Origin>;
type VetoOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>;
type CooloffPeriod: Get<Self::BlockNumber>;
type PreimageByteDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
type OperationalPreimageOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>;
type Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>;
type Scheduler: ScheduleNamed<Self::BlockNumber, Self::Proposal, Self::PalletsOrigin>;
type PalletsOrigin: From<RawOrigin<Self::AccountId>>;
type MaxVotes: Get<u32>;
type WeightInfo: WeightInfo;
type MaxProposals: Get<u32>;
}
Expand description
Configuration trait of this pallet.
Implement this type for a runtime in order to customize this pallet.
Required Associated Types§
type Proposal: Parameter + Dispatchable<Origin = Self::Origin> + From<Call<Self>>
type Event: From<Event<Self>> + IsType<<Self as Config>::Event>
sourcetype Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber>
type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber>
Currency type for this pallet.
sourcetype EnactmentPeriod: Get<Self::BlockNumber>
type EnactmentPeriod: Get<Self::BlockNumber>
The period between a proposal being approved and enacted.
It should generally be a little more than the unstake period to ensure that voting stakers have an opportunity to remove themselves from the system in the case where they are on the losing side of a vote.
sourcetype LaunchPeriod: Get<Self::BlockNumber>
type LaunchPeriod: Get<Self::BlockNumber>
How often (in blocks) new public referenda are launched.
sourcetype VotingPeriod: Get<Self::BlockNumber>
type VotingPeriod: Get<Self::BlockNumber>
How often (in blocks) to check for new votes.
sourcetype VoteLockingPeriod: Get<Self::BlockNumber>
type VoteLockingPeriod: Get<Self::BlockNumber>
The minimum period of vote locking.
It should be no shorter than enactment period to ensure that in the case of an approval, those successful voters are locked into the consequences that their votes entail.
sourcetype MinimumDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>
type MinimumDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>
The minimum amount to be used as a deposit for a public referendum proposal.
sourcetype ExternalOrigin: EnsureOrigin<Self::Origin>
type ExternalOrigin: EnsureOrigin<Self::Origin>
Origin from which the next tabled referendum may be forced. This is a normal “super-majority-required” referendum.
sourcetype ExternalMajorityOrigin: EnsureOrigin<Self::Origin>
type ExternalMajorityOrigin: EnsureOrigin<Self::Origin>
Origin from which the next tabled referendum may be forced; this allows for the tabling of a majority-carries referendum.
sourcetype ExternalDefaultOrigin: EnsureOrigin<Self::Origin>
type ExternalDefaultOrigin: EnsureOrigin<Self::Origin>
Origin from which the next tabled referendum may be forced; this allows for the tabling of a negative-turnout-bias (default-carries) referendum.
sourcetype FastTrackOrigin: EnsureOrigin<Self::Origin>
type FastTrackOrigin: EnsureOrigin<Self::Origin>
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.
sourcetype InstantOrigin: EnsureOrigin<Self::Origin>
type InstantOrigin: EnsureOrigin<Self::Origin>
Origin from which the next majority-carries (or more permissive) referendum may be tabled to vote immediately and asynchronously in a similar manner to the emergency origin. It retains its threshold method.
sourcetype InstantAllowed: Get<bool>
type InstantAllowed: Get<bool>
Indicator for whether an emergency origin is even allowed to happen. Some chains may
want to set this permanently to false
, others may want to condition it on things such
as an upgrade having happened recently.
sourcetype FastTrackVotingPeriod: Get<Self::BlockNumber>
type FastTrackVotingPeriod: Get<Self::BlockNumber>
Minimum voting period allowed for a fast-track referendum.
sourcetype CancellationOrigin: EnsureOrigin<Self::Origin>
type CancellationOrigin: EnsureOrigin<Self::Origin>
Origin from which any referendum may be cancelled in an emergency.
sourcetype BlacklistOrigin: EnsureOrigin<Self::Origin>
type BlacklistOrigin: EnsureOrigin<Self::Origin>
Origin from which proposals may be blacklisted.
sourcetype CancelProposalOrigin: EnsureOrigin<Self::Origin>
type CancelProposalOrigin: EnsureOrigin<Self::Origin>
Origin from which a proposal may be cancelled and its backers slashed.
sourcetype VetoOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>
type VetoOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>
Origin for anyone able to veto proposals.
Warning
The number of Vetoers for a proposal must be small, extrinsics are weighted according to MAX_VETOERS
sourcetype CooloffPeriod: Get<Self::BlockNumber>
type CooloffPeriod: Get<Self::BlockNumber>
Period in blocks where an external proposal may not be re-submitted after being vetoed.
sourcetype PreimageByteDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>
type PreimageByteDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>
The amount of balance that must be deposited per byte of preimage stored.
sourcetype OperationalPreimageOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>
type OperationalPreimageOrigin: EnsureOrigin<Self::Origin, Success = Self::AccountId>
An origin that can provide a preimage using operational extrinsics.
sourcetype Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when slashing a preimage deposit.
sourcetype Scheduler: ScheduleNamed<Self::BlockNumber, Self::Proposal, Self::PalletsOrigin>
type Scheduler: ScheduleNamed<Self::BlockNumber, Self::Proposal, Self::PalletsOrigin>
The Scheduler.
sourcetype PalletsOrigin: From<RawOrigin<Self::AccountId>>
type PalletsOrigin: From<RawOrigin<Self::AccountId>>
Overarching type of all pallets origins.
sourcetype MaxVotes: Get<u32>
type MaxVotes: Get<u32>
The maximum number of votes for an account.
Also used to compute weight, an overly big value can
lead to extrinsic with very big weight: see delegate
for instance.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype MaxProposals: Get<u32>
type MaxProposals: Get<u32>
The maximum number of public proposals that can exist at any time.