pub type FellowshipCollective = Pallet<Runtime, Instance1>;
Aliased Type§
struct FellowshipCollective(/* private fields */);
Implementations
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn add_member(
origin: <T as Config>::RuntimeOrigin,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn add_member( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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: <T as Config>::RuntimeOrigin,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn promote_member( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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: <T as Config>::RuntimeOrigin,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn demote_member( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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: <T as Config>::RuntimeOrigin,
who: <<T as Config>::Lookup as StaticLookup>::Source,
min_rank: u16,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn remove_member( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, min_rank: u16, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
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: <T as Config>::RuntimeOrigin,
poll: <<T as Config<I>>::Polls as Polling<Tally<T, I, Pallet<T, I>>>>::Index,
aye: bool,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn vote( origin: <T as Config>::RuntimeOrigin, poll: <<T as Config<I>>::Polls as Polling<Tally<T, I, Pallet<T, I>>>>::Index, aye: bool, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
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: <T as Config>::RuntimeOrigin,
poll_index: <<T as Config<I>>::Polls as Polling<Tally<T, I, Pallet<T, I>>>>::Index,
max: u32,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn cleanup_poll( origin: <T as Config>::RuntimeOrigin, poll_index: <<T as Config<I>>::Polls as Polling<Tally<T, I, Pallet<T, I>>>>::Index, max: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
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: <T as Config>::RuntimeOrigin,
who: <<T as Config>::Lookup as StaticLookup>::Source,
new_who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn exchange_member( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, new_who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn do_add_member(
who: <T as Config>::AccountId,
emit_event: bool,
) -> Result<(), DispatchError>
pub fn do_add_member( who: <T as Config>::AccountId, emit_event: bool, ) -> Result<(), DispatchError>
Adds a member into the ranked collective at level 0.
No origin checks are executed.
Sourcepub fn do_promote_member(
who: <T as Config>::AccountId,
maybe_max_rank: Option<u16>,
emit_event: bool,
) -> Result<(), DispatchError>
pub fn do_promote_member( who: <T as Config>::AccountId, maybe_max_rank: Option<u16>, emit_event: bool, ) -> Result<(), DispatchError>
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 as Config>::AccountId,
rank: u16,
emit_event: bool,
) -> Result<(), DispatchError>
pub fn do_add_member_to_rank( who: <T as Config>::AccountId, rank: u16, emit_event: bool, ) -> Result<(), DispatchError>
Add a member to the rank collective, and continue to promote them until a certain rank is reached.
Sourcepub fn as_rank(
o: &<<T as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin,
) -> Option<u16>
pub fn as_rank( o: &<<T as Config>::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 as Config>::AccountId,
rank: u16,
) -> Result<(), DispatchError>
pub fn do_remove_member_from_rank( who: &<T as Config>::AccountId, rank: u16, ) -> Result<(), DispatchError>
Removes a member from the rank collective
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn do_try_state() -> Result<(), DispatchError>
pub fn do_try_state() -> Result<(), DispatchError>
Ensure the correctness of the state of this pallet.
Trait Implementations
Source§impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
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§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
type RuntimeCall = Call<T, I>
Source§impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T, I> GetMaxVoters for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> GetMaxVoters for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§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, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn try_state(
_n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Result<(), DispatchError>
fn try_state( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§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, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> RankedMembers for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> RankedMembers for Pallet<T, I>where
T: Config<I>,
I: 'static,
type AccountId = <T as Config>::AccountId
type Rank = u16
Source§fn min_rank() -> <Pallet<T, I> as RankedMembers>::Rank
fn min_rank() -> <Pallet<T, I> as RankedMembers>::Rank
Source§fn rank_of(
who: &<Pallet<T, I> as RankedMembers>::AccountId,
) -> Option<<Pallet<T, I> as RankedMembers>::Rank>
fn rank_of( who: &<Pallet<T, I> as RankedMembers>::AccountId, ) -> Option<<Pallet<T, I> as RankedMembers>::Rank>
None
if they are not a member.Source§fn induct(
who: &<Pallet<T, I> as RankedMembers>::AccountId,
) -> Result<(), DispatchError>
fn induct( who: &<Pallet<T, I> as RankedMembers>::AccountId, ) -> Result<(), DispatchError>
min_rank()
.Source§fn promote(
who: &<Pallet<T, I> as RankedMembers>::AccountId,
) -> Result<(), DispatchError>
fn promote( who: &<Pallet<T, I> as RankedMembers>::AccountId, ) -> Result<(), DispatchError>
Source§fn demote(
who: &<Pallet<T, I> as RankedMembers>::AccountId,
) -> Result<(), DispatchError>
fn demote( who: &<Pallet<T, I> as RankedMembers>::AccountId, ) -> Result<(), DispatchError>
min_rank
removes the
member entirely.Source§impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
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.