[−][src]Struct pallet_scored_pool::Module
Implementations
impl<T: Trait<I> + 'static, I: Instance> Module<T, I>
[src]
pub fn pool() -> Vec<(<T as Trait>::AccountId, Option<<T as Trait<I>>::Score>)>
[src]
The current pool of candidates, stored as an ordered Vec
(ordered descending by score, None
last, highest first).
pub fn candidate_exists<K: EncodeLike<T::AccountId>>(key: K) -> bool
[src]
A Map of the candidates. The information in this Map is redundant
to the information in the Pool
. But the Map enables us to easily
check if a candidate is already in the pool, without having to
iterate over the entire pool (the Pool
is not sorted by
T::AccountId
, but by T::Score
instead).
pub fn members() -> Vec<T::AccountId>
[src]
The current membership, stored as an ordered Vec.
pub fn member_count() -> u32
[src]
Size of the Members
set.
impl<T: Trait<I>, I: Instance> Module<T, I>
[src]
Can also be called using Call
.
pub fn submit_candidacy(origin: T::Origin) -> DispatchResult
[src]
Add origin
to the pool of candidates.
This results in CandidateDeposit
being reserved from
the origin
account. The deposit is returned once
candidacy is withdrawn by the candidate or the entity
is kicked by KickOrigin
.
The dispatch origin of this function must be signed.
The index
parameter of this function must be set to
the index of the transactor in the Pool
.
pub fn withdraw_candidacy(origin: T::Origin, index: u32) -> DispatchResult
[src]
An entity withdraws candidacy and gets its deposit back.
If the entity is part of the Members
, then the highest member
of the Pool
that is not currently in Members
is immediately
placed in the set instead.
The dispatch origin of this function must be signed.
The index
parameter of this function must be set to
the index of the transactor in the Pool
.
pub fn kick(
origin: T::Origin,
dest: <T::Lookup as StaticLookup>::Source,
index: u32
) -> DispatchResult
[src]
origin: T::Origin,
dest: <T::Lookup as StaticLookup>::Source,
index: u32
) -> DispatchResult
Kick a member who
from the set.
May only be called from KickOrigin
or root.
The index
parameter of this function must be set to
the index of dest
in the Pool
.
pub fn score(
origin: T::Origin,
dest: <T::Lookup as StaticLookup>::Source,
index: u32,
score: T::Score
) -> DispatchResult
[src]
origin: T::Origin,
dest: <T::Lookup as StaticLookup>::Source,
index: u32,
score: T::Score
) -> DispatchResult
Score a member who
with score
.
May only be called from ScoreOrigin
or root.
The index
parameter of this function must be set to
the index of the dest
in the Pool
.
pub fn change_member_count(origin: T::Origin, count: u32) -> DispatchResult
[src]
Dispatchable call to change MemberCount
.
This will only have an effect the next time a refresh happens
(this happens each Period
).
May only be called from root.
Trait Implementations
impl<T: Trait<I>, I: Instance> Callable<T> for Module<T, I>
[src]
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]
T: Debug,
I: Debug,
impl<T: Eq + Trait<I>, I: Eq + Instance> Eq for Module<T, I>
[src]
impl<T: Trait<I>, I: Instance> ModuleErrorMetadata for Module<T, I>
[src]
fn metadata() -> &'static [ErrorMetadata]
[src]
impl<T: Trait<I>, I: Instance> OffchainWorker<<T as Trait>::BlockNumber> for Module<T, I>
[src]
fn offchain_worker(_n: BlockNumber)
[src]
impl<T: Trait<I>, I: Instance> OnFinalize<<T as Trait>::BlockNumber> for Module<T, I>
[src]
fn on_finalize(_n: BlockNumber)
[src]
impl<T: Trait<I>, I: Instance> OnInitialize<<T as Trait>::BlockNumber> for Module<T, I>
[src]
fn on_initialize(n: T::BlockNumber) -> Weight
[src]
impl<T: Trait<I>, I: Instance> OnRuntimeUpgrade for Module<T, I>
[src]
fn on_runtime_upgrade() -> u64
[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,
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for Module<T, I> where
I: Send,
T: Send,
I: Send,
T: Send,
impl<T, I> Sync for Module<T, I> where
I: Sync,
T: Sync,
I: Sync,
T: Sync,
impl<T, I> Unpin for Module<T, I> where
I: Unpin,
T: Unpin,
I: Unpin,
T: Unpin,
impl<T, I> UnwindSafe for Module<T, I> where
I: UnwindSafe,
T: UnwindSafe,
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
Get a reference to the inner from the outer.
fn from_mut(outer: &mut Outer) -> &mut T
Get a mutable reference to the inner from the outer.
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Member for T where
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
[src]
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Self: UniqueSaturatedFrom<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Self: UniqueSaturatedInto<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
impl<T, S> UniqueSaturatedInto<T> for S where
S: TryInto<T>,
T: Bounded,
S: TryInto<T>,
T: Bounded,
fn unique_saturated_into(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,