mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 12:51:05 +00:00
Update Pallet Bags List to use ListError (#11342)
* extract list error changes from kiz-revamp-sorted-list-providers-2-approval-stake * some fixes * weight -> score * Update tests.rs * Update tests.rs * more fixes * remove score updated event * Update frame/bags-list/src/lib.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -803,7 +803,7 @@ impl<T: Config> Pallet<T> {
|
||||
pub fn do_remove_nominator(who: &T::AccountId) -> bool {
|
||||
let outcome = if Nominators::<T>::contains_key(who) {
|
||||
Nominators::<T>::remove(who);
|
||||
T::VoterList::on_remove(who);
|
||||
let _ = T::VoterList::on_remove(who).defensive();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
@@ -850,7 +850,7 @@ impl<T: Config> Pallet<T> {
|
||||
pub fn do_remove_validator(who: &T::AccountId) -> bool {
|
||||
let outcome = if Validators::<T>::contains_key(who) {
|
||||
Validators::<T>::remove(who);
|
||||
T::VoterList::on_remove(who);
|
||||
let _ = T::VoterList::on_remove(who).defensive();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
@@ -1343,11 +1343,13 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseNominatorsAndValidatorsM
|
||||
// nothing to do on insert.
|
||||
Ok(())
|
||||
}
|
||||
fn on_update(_: &T::AccountId, _weight: Self::Score) {
|
||||
fn on_update(_: &T::AccountId, _weight: VoteWeight) -> Result<(), Self::Error> {
|
||||
// nothing to do on update.
|
||||
Ok(())
|
||||
}
|
||||
fn on_remove(_: &T::AccountId) {
|
||||
fn on_remove(_: &T::AccountId) -> Result<(), Self::Error> {
|
||||
// nothing to do on remove.
|
||||
Ok(())
|
||||
}
|
||||
fn unsafe_regenerate(
|
||||
_: impl IntoIterator<Item = T::AccountId>,
|
||||
|
||||
Reference in New Issue
Block a user