Struct pallet_collective::Module [−][src]
pub struct Module<T: Config<I>, I: Instance = DefaultInstance>(_);
Implementations
The hashes of the active proposals.
Actual proposal for a given hash, if it’s current.
Votes on a given proposal, if it is ongoing.
Proposals so far.
The current members of the collective. This is stored sorted (just by value).
Trait Implementations
Update the members of the collective. Votes are updated and the prime is reset.
NOTE: Does not enforce the expected MaxMembers
limit on the amount of members, but
the weight estimations rely on it to estimate dispatchable weight.
Weight
O(MP + N)
- where
M
old-members-count (governance-bounded) - where
N
new-members-count (governance-bounded) - where
P
proposals-count
- where
- DB:
- 1 storage read (codec
O(P)
) for reading the proposals P
storage mutations for updating the votes (codecO(M)
)- 1 storage write (codec
O(N)
) for storing the new members - 1 storage write (codec
O(1)
) for deleting the old prime
- 1 storage read (codec
fn change_members(
incoming: &[AccountId],
outgoing: &[AccountId],
new: Vec<AccountId, Global>
)
fn change_members(
incoming: &[AccountId],
outgoing: &[AccountId],
new: Vec<AccountId, Global>
)
A number of members incoming
just joined the set and replaced some outgoing
ones. The
new set is given by new
, and need not be sorted. Read more
Set the new members; they must already be sorted. This will compute the diff and use it to
call change_members_sorted
. Read more
fn compute_members_diff_sorted(
new_members: &[AccountId],
old_members: &[AccountId]
) -> (Vec<AccountId, Global>, Vec<AccountId, Global>)
fn compute_members_diff_sorted(
new_members: &[AccountId],
old_members: &[AccountId]
) -> (Vec<AccountId, Global>, Vec<AccountId, Global>)
Compute diff between new and old members; they must already be sorted. Read more
Returns the current storage version as supported by the pallet.
Returns the on-chain storage version of the pallet as stored in the storage.
Initialize the members to the given members
.
Run integrity test. Read more
impl<T: Config + Config<I>, I: Instance> OffchainWorker<<T as Config>::BlockNumber> for Module<T, I>
impl<T: Config + Config<I>, I: Instance> OffchainWorker<<T as Config>::BlockNumber> for Module<T, I>
This function is being called after every block import (when fully synced). Read more
impl<T: Config + Config<I>, I: Instance> OnFinalize<<T as Config>::BlockNumber> for Module<T, I>
impl<T: Config + Config<I>, I: Instance> OnFinalize<<T as Config>::BlockNumber> for Module<T, I>
The block is being finalized. Implement to have something happen. Read more
Something that should happen at genesis.
impl<T: Config + Config<I>, I: Instance> OnInitialize<<T as Config>::BlockNumber> for Module<T, I>
impl<T: Config + Config<I>, I: Instance> OnInitialize<<T as Config>::BlockNumber> for Module<T, I>
The block is being initialized. Implement to have something happen. Read more
Auto Trait Implementations
impl<T, I> RefUnwindSafe for Module<T, I> where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> UnwindSafe for Module<T, I> where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generate a storage key unique to this runtime upgrade. Read more
Get temporary storage data written by Self::set_temp_storage
. Read more
Write some temporary data to a specific storage that can be read (potentially in
post-upgrade hook) via Self::get_temp_storage
. Read more
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,