Skip to content

Commit 7c1c900

Browse files
committed
fix: improve post_upgrade
1 parent 45efea1 commit 7c1c900

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

runtime/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,10 +1207,12 @@ mod account_data_migration {
12071207

12081208
for acc in account_ids {
12091209
// Ensure account exists in storage and decodes.
1210-
ensure!(
1211-
frame_system::pallet::Account::<Runtime>::try_get(&acc).is_ok(),
1212-
"account not found"
1213-
);
1210+
match frame_system::pallet::Account::<Runtime>::try_get(&acc) {
1211+
Ok(d) => {
1212+
ensure!(d.data.free > 0 || d.data.reserved > 0, "account has 0 bal");
1213+
}
1214+
_ => { panic!("account not found") }
1215+
};
12141216

12151217
// Ensure account provider is >0.
12161218
ensure!(

0 commit comments

Comments
 (0)