mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-23 11:55:42 +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:
@@ -64,19 +64,19 @@ fn main() {
|
||||
Action::Insert => {
|
||||
if BagsList::on_insert(id, vote_weight).is_err() {
|
||||
// this was a duplicate id, which is ok. We can just update it.
|
||||
BagsList::on_update(&id, vote_weight);
|
||||
BagsList::on_update(&id, vote_weight).unwrap();
|
||||
}
|
||||
assert!(BagsList::contains(&id));
|
||||
},
|
||||
Action::Update => {
|
||||
let already_contains = BagsList::contains(&id);
|
||||
BagsList::on_update(&id, vote_weight);
|
||||
BagsList::on_update(&id, vote_weight).unwrap();
|
||||
if already_contains {
|
||||
assert!(BagsList::contains(&id));
|
||||
}
|
||||
},
|
||||
Action::Remove => {
|
||||
BagsList::on_remove(&id);
|
||||
BagsList::on_remove(&id).unwrap();
|
||||
assert!(!BagsList::contains(&id));
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user