Skip to content

Commit

Permalink
More checks
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimor committed Sep 29, 2024
1 parent ac10dc3 commit 41b53cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ impl FixMigration {
(2101, 298800),
];

if PotentialRenewals::<Runtime>::iter().count() != premature_renewals.len() {
log::error!(target: TARGET, "Unexpected renewal state!");
}

if PotentialRenewals::<Runtime>::clear(premature_renewals.len() as u32, None)
.maybe_cursor
.is_some()
Expand Down Expand Up @@ -253,6 +257,9 @@ impl OnRuntimeUpgrade for FixMigration {
let sale_info = SaleInfo::<Runtime>::get().unwrap();
let leases = Leases::<Runtime>::get();
let pre_upgrade_state = (sale_info, leases);

assert_eq!(PotentialRenewals::<Runtime>::iter().count(), INCORRECT_RENEWAL_IDS.len());

Ok(pre_upgrade_state.encode())
}

Expand Down

0 comments on commit 41b53cb

Please sign in to comment.