Trait pallet_democracy::pallet::Config
source · pub trait Config: Config + Sized {
Show 29 associated items
type WeightInfo: WeightInfo;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type Scheduler: ScheduleNamed<BlockNumberFor<Self>, CallOf<Self>, Self::PalletsOrigin, Hasher = Self::Hashing>;
type Preimages: QueryPreimage<H = Self::Hashing> + StorePreimage;
type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = BlockNumberFor<Self>>;
type EnactmentPeriod: Get<BlockNumberFor<Self>>;
type LaunchPeriod: Get<BlockNumberFor<Self>>;
type VotingPeriod: Get<BlockNumberFor<Self>>;
type VoteLockingPeriod: Get<BlockNumberFor<Self>>;
type MinimumDeposit: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
type InstantAllowed: Get<bool>;
type FastTrackVotingPeriod: Get<BlockNumberFor<Self>>;
type CooloffPeriod: Get<BlockNumberFor<Self>>;
type MaxVotes: Get<u32>;
type MaxProposals: Get<u32>;
type MaxDeposits: Get<u32>;
type MaxBlacklisted: Get<u32>;
type ExternalOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type ExternalMajorityOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type ExternalDefaultOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type SubmitOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type FastTrackOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type InstantOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type CancellationOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type BlacklistOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type CancelProposalOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type VetoOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type PalletsOrigin: From<RawOrigin<Self::AccountId>>;
type Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
type WeightInfo: WeightInfo
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
sourcetype Scheduler: ScheduleNamed<BlockNumberFor<Self>, CallOf<Self>, Self::PalletsOrigin, Hasher = Self::Hashing>
type Scheduler: ScheduleNamed<BlockNumberFor<Self>, CallOf<Self>, Self::PalletsOrigin, Hasher = Self::Hashing>
The Scheduler.
sourcetype Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = BlockNumberFor<Self>>
type Currency: ReservableCurrency<Self::AccountId> + LockableCurrency<Self::AccountId, Moment = BlockNumberFor<Self>>
Currency type for this pallet.
sourcetype EnactmentPeriod: Get<BlockNumberFor<Self>>
type EnactmentPeriod: Get<BlockNumberFor<Self>>
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<BlockNumberFor<Self>>
type LaunchPeriod: Get<BlockNumberFor<Self>>
How often (in blocks) new public referenda are launched.
sourcetype VotingPeriod: Get<BlockNumberFor<Self>>
type VotingPeriod: Get<BlockNumberFor<Self>>
How often (in blocks) to check for new votes.
sourcetype VoteLockingPeriod: Get<BlockNumberFor<Self>>
type VoteLockingPeriod: Get<BlockNumberFor<Self>>
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 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<BlockNumberFor<Self>>
type FastTrackVotingPeriod: Get<BlockNumberFor<Self>>
Minimum voting period allowed for a fast-track referendum.
sourcetype CooloffPeriod: Get<BlockNumberFor<Self>>
type CooloffPeriod: Get<BlockNumberFor<Self>>
Period in blocks where an external proposal may not be re-submitted after being vetoed.
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 MaxProposals: Get<u32>
type MaxProposals: Get<u32>
The maximum number of public proposals that can exist at any time.
sourcetype MaxDeposits: Get<u32>
type MaxDeposits: Get<u32>
The maximum number of deposits a public proposal may have at any time.
sourcetype MaxBlacklisted: Get<u32>
type MaxBlacklisted: Get<u32>
The maximum number of items which can be blacklisted.
sourcetype ExternalOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ExternalOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which the next tabled referendum may be forced. This is a normal “super-majority-required” referendum.
sourcetype ExternalMajorityOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ExternalMajorityOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which the next tabled referendum may be forced; this allows for the tabling of a majority-carries referendum.
sourcetype ExternalDefaultOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ExternalDefaultOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which the next tabled referendum may be forced; this allows for the tabling of a negative-turnout-bias (default-carries) referendum.
sourcetype SubmitOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
type SubmitOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
Origin from which the new proposal can be made.
The success variant is the account id of the depositor.
sourcetype FastTrackOrigin: EnsureOrigin<Self::RuntimeOrigin>
type FastTrackOrigin: EnsureOrigin<Self::RuntimeOrigin>
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::RuntimeOrigin>
type InstantOrigin: EnsureOrigin<Self::RuntimeOrigin>
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 CancellationOrigin: EnsureOrigin<Self::RuntimeOrigin>
type CancellationOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which any referendum may be cancelled in an emergency.
sourcetype BlacklistOrigin: EnsureOrigin<Self::RuntimeOrigin>
type BlacklistOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which proposals may be blacklisted.
sourcetype CancelProposalOrigin: EnsureOrigin<Self::RuntimeOrigin>
type CancelProposalOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin from which a proposal may be cancelled and its backers slashed.
sourcetype VetoOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
type VetoOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>
Origin for anyone able to veto proposals.
sourcetype PalletsOrigin: From<RawOrigin<Self::AccountId>>
type PalletsOrigin: From<RawOrigin<Self::AccountId>>
Overarching type of all pallets origins.