pub type Module<T, I = ()> = Pallet<T, I>;
Pallet
insteadExpand description
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
Aliased Type§
struct Module<T, I = ()>(/* private fields */);
Implementations
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
Sourcepub fn add_member(
origin: OriginFor<T>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> DispatchResult
pub fn add_member( origin: OriginFor<T>, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> DispatchResult
Introduce a new member.
origin
: Must be theAddOrigin
.who
: Account of non-member which will become a member.
Weight: O(1)
Sourcepub fn promote_member(
origin: OriginFor<T>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> DispatchResult
pub fn promote_member( origin: OriginFor<T>, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> DispatchResult
Increment the rank of an existing member by one.
origin
: Must be thePromoteOrigin
.who
: Account of existing member.
Weight: O(1)
Sourcepub fn demote_member(
origin: OriginFor<T>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> DispatchResult
pub fn demote_member( origin: OriginFor<T>, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> DispatchResult
Decrement the rank of an existing member by one. If the member is already at rank zero, then they are removed entirely.
origin
: Must be theDemoteOrigin
.who
: Account of existing member of rank greater than zero.
Weight: O(1)
, less if the member’s index is highest in its rank.
Sourcepub fn remove_member(
origin: OriginFor<T>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
min_rank: Rank,
) -> DispatchResultWithPostInfo
pub fn remove_member( origin: OriginFor<T>, who: <<T as Config>::Lookup as StaticLookup>::Source, min_rank: Rank, ) -> DispatchResultWithPostInfo
Remove the member entirely.
origin
: Must be theRemoveOrigin
.who
: Account of existing member of rank greater than zero.min_rank
: The rank of the member or greater.
Weight: O(min_rank)
.
Sourcepub fn vote(
origin: OriginFor<T>,
poll: PollIndexOf<T, I>,
aye: bool,
) -> DispatchResultWithPostInfo
pub fn vote( origin: OriginFor<T>, poll: PollIndexOf<T, I>, aye: bool, ) -> DispatchResultWithPostInfo
Add an aye or nay vote for the sender to the given proposal.
origin
: Must beSigned
by a member account.poll
: Index of a poll which is ongoing.aye
:true
if the vote is to approve the proposal,false
otherwise.
Transaction fees are be waived if the member is voting on any particular proposal for the first time and the call is successful. Subsequent vote changes will charge a fee.
Weight: O(1)
, less if there was no previous vote on the poll by the member.
Sourcepub fn cleanup_poll(
origin: OriginFor<T>,
poll_index: PollIndexOf<T, I>,
max: u32,
) -> DispatchResultWithPostInfo
pub fn cleanup_poll( origin: OriginFor<T>, poll_index: PollIndexOf<T, I>, max: u32, ) -> DispatchResultWithPostInfo
Remove votes from the given poll. It must have ended.
origin
: Must beSigned
by any account.poll_index
: Index of a poll which is completed and for which votes continue to exist.max
: Maximum number of vote items from remove in this call.
Transaction fees are waived if the operation is successful.
Weight O(max)
(less if there are fewer items to remove than max
).
Sourcepub fn exchange_member(
origin: OriginFor<T>,
who: <<T as Config>::Lookup as StaticLookup>::Source,
new_who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> DispatchResult
pub fn exchange_member( origin: OriginFor<T>, who: <<T as Config>::Lookup as StaticLookup>::Source, new_who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> DispatchResult
Exchanges a member with a new account and the same existing rank.
origin
: Must be theExchangeOrigin
.who
: Account of existing member of rank greater than zero to be exchanged.new_who
: New Account of existing member of rank greater than zero to exchanged to.
Source§impl<T: Config<I>, I: 'static> Pallet<T, I>
impl<T: Config<I>, I: 'static> Pallet<T, I>
Sourcepub fn do_add_member(who: T::AccountId, emit_event: bool) -> DispatchResult
pub fn do_add_member(who: T::AccountId, emit_event: bool) -> DispatchResult
Adds a member into the ranked collective at level 0.
No origin checks are executed.
Sourcepub fn do_promote_member(
who: T::AccountId,
maybe_max_rank: Option<Rank>,
emit_event: bool,
) -> DispatchResult
pub fn do_promote_member( who: T::AccountId, maybe_max_rank: Option<Rank>, emit_event: bool, ) -> DispatchResult
Promotes a member in the ranked collective into the next higher rank.
A maybe_max_rank
may be provided to check that the member does not get promoted beyond
a certain rank. Is None
is provided, then the rank will be incremented without checks.
Sourcepub fn do_add_member_to_rank(
who: T::AccountId,
rank: Rank,
emit_event: bool,
) -> DispatchResult
pub fn do_add_member_to_rank( who: T::AccountId, rank: Rank, emit_event: bool, ) -> DispatchResult
Add a member to the rank collective, and continue to promote them until a certain rank is reached.
Sourcepub fn as_rank(
o: &<T::RuntimeOrigin as OriginTrait>::PalletsOrigin,
) -> Option<u16>
pub fn as_rank( o: &<T::RuntimeOrigin as OriginTrait>::PalletsOrigin, ) -> Option<u16>
Determine the rank of the account behind the Signed
origin o
, None
if the account
is unknown to this collective or o
is not Signed
.
Sourcepub fn do_remove_member_from_rank(
who: &T::AccountId,
rank: Rank,
) -> DispatchResult
pub fn do_remove_member_from_rank( who: &T::AccountId, rank: Rank, ) -> DispatchResult
Removes a member from the rank collective
Trait Implementations
Source§impl<T: Config<I>, I: 'static> BeforeAllRuntimeMigrations for Pallet<T, I>
impl<T: Config<I>, I: 'static> BeforeAllRuntimeMigrations for Pallet<T, I>
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T, I> Benchmarking for Pallet<T, I>
impl<T, I> Benchmarking for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> Callable<T> for Pallet<T, I>
impl<T: Config<I>, I: 'static> Callable<T> for Pallet<T, I>
type RuntimeCall = Call<T, I>
Source§impl<T: Config<I>, I: 'static> GetMaxVoters for Pallet<T, I>
impl<T: Config<I>, I: 'static> GetMaxVoters for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> GetStorageVersion for Pallet<T, I>
impl<T: Config<I>, I: 'static> GetStorageVersion for Pallet<T, I>
Source§type InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
Source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
] instead. Read moreSource§impl<T: Config<I>, I: 'static> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
Source§impl<T: Config<I>, I: 'static> IntegrityTest for Pallet<T, I>
impl<T: Config<I>, I: 'static> IntegrityTest for Pallet<T, I>
Source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].Source§impl<T: Config<I>, I: 'static> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
Source§impl<T: Config<I>, I: 'static> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].Source§impl<T: Config<I>, I: 'static> OnGenesis for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnGenesis for Pallet<T, I>
Source§fn on_genesis()
fn on_genesis()
Source§impl<T: Config<I>, I: 'static> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].Source§impl<T: Config<I>, I: 'static> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for Pallet<T, I>
impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for Pallet<T, I>
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T: Config<I>, I: 'static> PalletInfoAccess for Pallet<T, I>
impl<T: Config<I>, I: 'static> PalletInfoAccess for Pallet<T, I>
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T: Config<I>, I: 'static> RankedMembers for Pallet<T, I>
impl<T: Config<I>, I: 'static> RankedMembers for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> StorageInfoTrait for Pallet<T, I>
impl<T: Config<I>, I: 'static> StorageInfoTrait for Pallet<T, I>
fn storage_info() -> Vec<StorageInfo>
Source§impl<T: Config<I>, I: 'static> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
impl<T: Config<I>, I: 'static> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
Source§impl<T: Config<I>, I: 'static> WhitelistedStorageKeys for Pallet<T, I>
impl<T: Config<I>, I: 'static> WhitelistedStorageKeys for Pallet<T, I>
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.