pub type VoterList = Pallet<Runtime, Instance1>;
Aliased Type§
struct VoterList(/* 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 rebag(
origin: <T as Config>::RuntimeOrigin,
dislocated: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn rebag( origin: <T as Config>::RuntimeOrigin, dislocated: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Declare that some dislocated
account has, through rewards or penalties, sufficiently
changed its score that it should properly fall into a different bag than its current
one.
Anyone can call this function about any potentially dislocated account.
Will always update the stored score of dislocated
to the correct score, based on
ScoreProvider
.
If dislocated
does not exists, it returns an error.
Sourcepub fn put_in_front_of(
origin: <T as Config>::RuntimeOrigin,
lighter: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn put_in_front_of( origin: <T as Config>::RuntimeOrigin, lighter: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Move the caller’s Id directly in front of lighter
.
The dispatch origin for this call must be Signed and can only be called by the Id of
the account going in front of lighter
. Fee is payed by the origin under all
circumstances.
Only works if:
- both nodes are within the same bag,
- and
origin
has a greaterScore
thanlighter
.
Sourcepub fn put_in_front_of_other(
origin: <T as Config>::RuntimeOrigin,
heavier: <<T as Config>::Lookup as StaticLookup>::Source,
lighter: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn put_in_front_of_other( origin: <T as Config>::RuntimeOrigin, heavier: <<T as Config>::Lookup as StaticLookup>::Source, lighter: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Same as Pallet::put_in_front_of
, but it can be called by anyone.
Fee is paid by the origin under all circumstances.
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,
pub fn do_try_state() -> Result<(), DispatchError>
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_rebag(
account: &<T as Config>::AccountId,
new_score: <T as Config<I>>::Score,
) -> Result<Option<(<T as Config<I>>::Score, <T as Config<I>>::Score)>, ListError>
pub fn do_rebag( account: &<T as Config>::AccountId, new_score: <T as Config<I>>::Score, ) -> Result<Option<(<T as Config<I>>::Score, <T as Config<I>>::Score)>, ListError>
Move an account from one bag to another, depositing an event on success.
If the account changed bags, returns Ok(Some((from, to)))
.
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> 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 integrity_test()
fn integrity_test()
Source§fn try_state(
_: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Result<(), DispatchError>
fn try_state( _: <<<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§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> ScoreProvider<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ScoreProvider<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> SortedListProvider<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> SortedListProvider<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn iter() -> Box<dyn Iterator<Item = <T as Config>::AccountId>>
fn iter() -> Box<dyn Iterator<Item = <T as Config>::AccountId>>
take
called on it.Source§fn iter_from(
start: &<T as Config>::AccountId,
) -> Result<Box<dyn Iterator<Item = <T as Config>::AccountId>>, <Pallet<T, I> as SortedListProvider<<T as Config>::AccountId>>::Error>
fn iter_from( start: &<T as Config>::AccountId, ) -> Result<Box<dyn Iterator<Item = <T as Config>::AccountId>>, <Pallet<T, I> as SortedListProvider<<T as Config>::AccountId>>::Error>
Source§fn contains(id: &<T as Config>::AccountId) -> bool
fn contains(id: &<T as Config>::AccountId) -> bool
id
.Source§fn on_insert(
id: <T as Config>::AccountId,
score: <T as Config<I>>::Score,
) -> Result<(), ListError>
fn on_insert( id: <T as Config>::AccountId, score: <T as Config<I>>::Score, ) -> Result<(), ListError>
Source§fn get_score(
id: &<T as Config>::AccountId,
) -> Result<<T as Config<I>>::Score, ListError>
fn get_score( id: &<T as Config>::AccountId, ) -> Result<<T as Config<I>>::Score, ListError>
id
.Source§fn on_update(
id: &<T as Config>::AccountId,
new_score: <T as Config<I>>::Score,
) -> Result<(), ListError>
fn on_update( id: &<T as Config>::AccountId, new_score: <T as Config<I>>::Score, ) -> Result<(), ListError>
Source§fn on_remove(id: &<T as Config>::AccountId) -> Result<(), ListError>
fn on_remove(id: &<T as Config>::AccountId) -> Result<(), ListError>
Source§fn unsafe_regenerate(
all: impl IntoIterator<Item = <T as Config>::AccountId>,
score_of: Box<dyn Fn(&<T as Config>::AccountId) -> <T as Config<I>>::Score>,
) -> u32
fn unsafe_regenerate( all: impl IntoIterator<Item = <T as Config>::AccountId>, score_of: Box<dyn Fn(&<T as Config>::AccountId) -> <T as Config<I>>::Score>, ) -> u32
Source§fn try_state() -> Result<(), DispatchError>
fn try_state() -> Result<(), DispatchError>
Source§fn unsafe_clear()
fn unsafe_clear()
Source§fn score_update_worst_case(
who: &<T as Config>::AccountId,
is_increase: bool,
) -> <Pallet<T, I> as SortedListProvider<<T as Config>::AccountId>>::Score
fn score_update_worst_case( who: &<T as Config>::AccountId, is_increase: bool, ) -> <Pallet<T, I> as SortedListProvider<<T as Config>::AccountId>>::Score
who
changes by the returned amount they are guaranteed to have a worst case change
in their list position.Source§fn on_increase(
id: &AccountId,
additional: Self::Score,
) -> Result<(), Self::Error>
fn on_increase( id: &AccountId, additional: Self::Score, ) -> Result<(), Self::Error>
on_update
, but incorporate some increased score.Source§fn on_decrease(
id: &AccountId,
decreased: Self::Score,
) -> Result<(), Self::Error>
fn on_decrease( id: &AccountId, decreased: Self::Score, ) -> Result<(), Self::Error>
on_update
, but incorporate some decreased score. Read moreSource§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.