mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
committed by
GitHub
parent
cac9d85cb3
commit
fcfb766366
@@ -19,11 +19,11 @@
|
||||
//!
|
||||
//! A semi-sorted list, where items hold an `AccountId` based on some `VoteWeight`. The `AccountId`
|
||||
//! (`id` for short) might be synonym to a `voter` or `nominator` in some context, and `VoteWeight`
|
||||
//! signifies the chance of each id being included in the final [`VoteWeightProvider::iter`].
|
||||
//! signifies the chance of each id being included in the final [`SortedListProvider::iter`].
|
||||
//!
|
||||
//! It implements [`sp_election_provider_support::SortedListProvider`] to provide a semi-sorted list
|
||||
//! of accounts to another pallet. It needs some other pallet to give it some information about the
|
||||
//! weights of accounts via [`sp_election_provider_support::VoteWeightProvider`].
|
||||
//! It implements [`frame_election_provider_support::SortedListProvider`] to provide a semi-sorted
|
||||
//! list of accounts to another pallet. It needs some other pallet to give it some information about
|
||||
//! the weights of accounts via [`frame_election_provider_support::VoteWeightProvider`].
|
||||
//!
|
||||
//! This pallet is not configurable at genesis. Whoever uses it should call appropriate functions of
|
||||
//! the `SortedListProvider` (e.g. `on_insert`, or `regenerate`) at their genesis.
|
||||
@@ -38,7 +38,8 @@
|
||||
//!
|
||||
//! # Details
|
||||
//!
|
||||
//! - items are kept in bags, which are delineated by their range of weight (See [`BagThresholds`]).
|
||||
//! - items are kept in bags, which are delineated by their range of weight (See
|
||||
//! [`Config::BagThresholds`]).
|
||||
//! - for iteration, bags are chained together from highest to lowest and elements within the bag
|
||||
//! are iterated from head to tail.
|
||||
//! - items within a bag are iterated in order of insertion. Thus removing an item and re-inserting
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
//! Implementation of a "bags list": a semi-sorted list where ordering granularity is dictated by
|
||||
//! configurable thresholds that delineate the boundaries of bags. It uses a pattern of composite
|
||||
//! data structures, where multiple storage items are masked by one outer API. See [`ListNodes`],
|
||||
//! [`ListBags`] for more information.
|
||||
//! data structures, where multiple storage items are masked by one outer API. See
|
||||
//! [`crate::ListNodes`], [`crate::ListBags`] for more information.
|
||||
//!
|
||||
//! The outer API of this module is the [`List`] struct. It wraps all acceptable operations on top
|
||||
//! of the aggregate linked list. All operations with the bags list should happen through this
|
||||
@@ -460,7 +460,7 @@ impl<T: Config> List<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A Bag is a doubly-linked list of ids, where each id is mapped to a [`ListNode`].
|
||||
/// A Bag is a doubly-linked list of ids, where each id is mapped to a [`Node`].
|
||||
///
|
||||
/// Note that we maintain both head and tail pointers. While it would be possible to get away with
|
||||
/// maintaining only a head pointer and cons-ing elements onto the front of the list, it's more
|
||||
|
||||
Reference in New Issue
Block a user