Skip to content

Commit

Permalink
add more logging for democracy migration
Browse files Browse the repository at this point in the history
  • Loading branch information
apopiak committed Jun 29, 2020
1 parent acc62be commit f851407
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frame/democracy/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ pub fn migrate_account<T: Trait>(a: &T::AccountId) {
pub fn migrate_all<T: Trait>() -> Weight {
sp_runtime::print("🕊️ Migrating Democracy...");
let mut weight = 0;
sp_runtime::print("Democracy: Hasher");
weight += migrate_hasher::<T>();
sp_runtime::print("Democracy: Remove Unused");
weight += migrate_remove_unused_storage::<T>();
sp_runtime::print("Democracy: ReferendumInfo");
weight += migrate_referendum_info::<T>();
sp_runtime::print("🕊️ Done Democracy.");
weight
Expand All @@ -89,11 +92,13 @@ pub fn migrate_hasher<T: Trait>() -> Weight {
// TODO: is this valid?
Blacklist::<T>::remove_all();
Cancellations::<T>::remove_all();
// Not this only migrates the hasher, `ReferendumInfoOf` is fully migrated in
// Note this only migrates the hasher, `ReferendumInfoOf` is fully migrated in
// `migrate_referendum_info`.
sp_runtime::print("Democracy: Hasher: ReferendumInfo");
for i in LowestUnbaked::get()..ReferendumCount::get() {
deprecated::ReferendumInfoOf::<T>::migrate_key_from_blake(i);
}
sp_runtime::print("Democracy: Hasher: PublicProps");
for (p, h, _) in PublicProps::<T>::get().into_iter() {
DepositOf::<T>::migrate_key_from_blake(p);
Preimages::<T>::migrate_key_from_blake(h);
Expand Down

0 comments on commit f851407

Please sign in to comment.