[][src]Struct pallet_collective::Module

pub struct Module<T: Trait<I>, I: Instance = DefaultInstance>(_);

Implementations

impl<T: Trait<I> + 'static, I: Instance> Module<T, I>[src]

pub fn proposals() -> Vec<T::Hash>[src]

The hashes of the active proposals.

pub fn proposal_of<K: EncodeLike<T::Hash>>(
    key: K
) -> Option<<T as Trait<I>>::Proposal>
[src]

Actual proposal for a given hash, if it's current.

pub fn voting<K: EncodeLike<T::Hash>>(
    key: K
) -> Option<Votes<T::AccountId, T::BlockNumber>>
[src]

Votes on a given proposal, if it is ongoing.

pub fn proposal_count() -> u32[src]

Proposals so far.

pub fn members() -> Vec<T::AccountId>[src]

The current members of the collective. This is stored sorted (just by value).

pub fn prime() -> Option<T::AccountId>[src]

The prime member that helps determine the default vote behavior in case of absentations.

impl<T: Trait<I>, I: Instance> Module<T, I>[src]

pub fn is_member(who: &T::AccountId) -> bool[src]

Check whether who is a member of the collective.

Trait Implementations

impl<T: Trait<I>, I: Instance> Callable<T> for Module<T, I>[src]

type Call = Call<T, I>

impl<T: Trait<I>, I: Instance> ChangeMembers<<T as Trait>::AccountId> for Module<T, I>[src]

pub fn change_members_sorted(
    _incoming: &[T::AccountId],
    outgoing: &[T::AccountId],
    new: &[T::AccountId]
)
[src]

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
  • DB:
    • 1 storage read (codec O(P)) for reading the proposals
    • P storage mutations for updating the votes (codec O(M))
    • 1 storage write (codec O(N)) for storing the new members
    • 1 storage write (codec O(1)) for deleting the old prime

impl<T: Clone + Trait<I>, I: Clone + Instance> Clone for Module<T, I>[src]

impl<T: Copy + Trait<I>, I: Copy + Instance> Copy for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> Debug for Module<T, I> where
    T: Debug,
    I: Debug
[src]

impl<T: Eq + Trait<I>, I: Eq + Instance> Eq for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> InitializeMembers<<T as Trait>::AccountId> for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> IntegrityTest for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> ModuleErrorMetadata for Module<T, I>[src]

impl<T: Trait + Trait<I>, I: Instance> OffchainWorker<<T as Trait>::BlockNumber> for Module<T, I>[src]

impl<T: Trait + Trait<I>, I: Instance> OnFinalize<<T as Trait>::BlockNumber> for Module<T, I>[src]

impl<T: Trait + Trait<I>, I: Instance> OnInitialize<<T as Trait>::BlockNumber> for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> OnRuntimeUpgrade for Module<T, I>[src]

impl<T: PartialEq + Trait<I>, I: PartialEq + Instance> PartialEq<Module<T, I>> for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> StructuralEq for Module<T, I>[src]

impl<T: Trait<I>, I: Instance> StructuralPartialEq for Module<T, I>[src]

Auto Trait Implementations

impl<T, I> RefUnwindSafe for Module<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, I> Send for Module<T, I> where
    I: Send,
    T: Send
[src]

impl<T, I> Sync for Module<T, I> where
    I: Sync,
    T: Sync
[src]

impl<T, I> Unpin for Module<T, I> where
    I: Unpin,
    T: Unpin
[src]

impl<T, I> UnwindSafe for Module<T, I> where
    I: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IsType<T> for T[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,