mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 16:01:04 +00:00
Add Score to Bags List (#11357)
* Add Score to Bags List * fix ordering * make compile * in progress migration * make migration compile * remove old check * remove runtime specific migration * fix warning * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * improve migration * fix * fix merge * fmt * Update migrations.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -70,13 +70,20 @@ fn main() {
|
||||
},
|
||||
Action::Update => {
|
||||
let already_contains = BagsList::contains(&id);
|
||||
BagsList::on_update(&id, vote_weight).unwrap();
|
||||
if already_contains {
|
||||
BagsList::on_update(&id, vote_weight).unwrap();
|
||||
assert!(BagsList::contains(&id));
|
||||
} else {
|
||||
BagsList::on_update(&id, vote_weight).unwrap_err();
|
||||
}
|
||||
},
|
||||
Action::Remove => {
|
||||
BagsList::on_remove(&id).unwrap();
|
||||
let already_contains = BagsList::contains(&id);
|
||||
if already_contains {
|
||||
BagsList::on_remove(&id).unwrap();
|
||||
} else {
|
||||
BagsList::on_remove(&id).unwrap_err();
|
||||
}
|
||||
assert!(!BagsList::contains(&id));
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user