File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
pallets/subtensor/src/migrations Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -24,24 +24,23 @@ pub fn migrate_remove_total_hotkey_coldkey_stakes_this_interval<T: Config>() ->
2424
2525 // Remove all entries.
2626 let removed_entries_count = match clear_prefix ( & prefix, Some ( u32:: MAX ) ) {
27- KillStorageResult :: AllRemoved ( removed) => removed as u64 ,
27+ KillStorageResult :: AllRemoved ( removed) => {
28+ log:: info!( "Removed all entries from {:?}." , storage_name) ;
29+
30+ // Mark migration as completed
31+ HasMigrationRun :: < T > :: insert ( & migration_name_bytes, true ) ;
32+ weight = weight. saturating_add ( T :: DbWeight :: get ( ) . writes ( 1 ) ) ;
33+
34+ removed as u64
35+ }
2836 KillStorageResult :: SomeRemaining ( removed) => {
29- log:: info!( "Failed to remove all entries from {:?}" , migration_name ) ;
37+ log:: info!( "Failed to remove all entries from {:?}" , storage_name ) ;
3038 removed as u64
3139 }
3240 } ;
3341
3442 weight = weight. saturating_add ( T :: DbWeight :: get ( ) . writes ( removed_entries_count as u64 ) ) ;
3543
36- log:: info!(
37- "Removed {:?} entries from TotalHotkeyColdkeyStakesThisInterval." ,
38- removed_entries_count
39- ) ;
40-
41- // Mark migration as completed
42- HasMigrationRun :: < T > :: insert ( & migration_name_bytes, true ) ;
43- weight = weight. saturating_add ( T :: DbWeight :: get ( ) . writes ( 1 ) ) ;
44-
4544 log:: info!(
4645 "Migration '{:?}' completed successfully. {:?} entries removed." ,
4746 migration_name,
You can’t perform that action at this time.
0 commit comments