Make bags-list generic over node value and instantiable (#10997)

* make instantiable

* update

* cargo fmt

* Clean up

* bags-list: Make it generic over node value

* Respond to some feedback

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Add back default impl for weight update worst case

* Update to Score in more places'

* Use VoteWeight, not u64 to reduce test diff

* FMT

* FullCodec implies Codec

* formatting

* Fixup bags list remote test

Co-authored-by: doordashcon <jesse.chejieh@gmail.com>
Co-authored-by: Doordashcon <90750465+Doordashcon@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Zeke Mostov
2022-03-09 16:28:28 +00:00
committed by GitHub
parent 64f6664691
commit f8e0e41e15
14 changed files with 428 additions and 283 deletions
+4 -1
View File
@@ -166,7 +166,10 @@ pub mod pallet {
/// Something that can provide a sorted list of voters in a somewhat sorted way. The
/// original use case for this was designed with `pallet_bags_list::Pallet` in mind. If
/// the bags-list is not desired, [`impls::UseNominatorsMap`] is likely the desired option.
type SortedListProvider: SortedListProvider<Self::AccountId>;
type SortedListProvider: SortedListProvider<
Self::AccountId,
Score = frame_election_provider_support::VoteWeight,
>;
/// The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
/// determines how many unique eras a staker may be unbonding in.