File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
pallets/subtensor/src/migrations Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub fn migrate_subnet_volume<T: Config>() -> Weight {
66 let migration_name = b"migrate_subnet_volume" . to_vec ( ) ;
77
88 // Initialize the weight with one read operation.
9- let weight = T :: DbWeight :: get ( ) . reads ( 1 ) ;
9+ let mut weight = T :: DbWeight :: get ( ) . reads ( 1 ) ;
1010
1111 // Check if the migration has already run
1212 if HasMigrationRun :: < T > :: get ( & migration_name) {
@@ -29,5 +29,11 @@ pub fn migrate_subnet_volume<T: Config>() -> Weight {
2929 } ) ;
3030
3131 log:: info!( "Migrated {} entries in SubnetVolume" , migrated) ;
32- weight. saturating_add ( T :: DbWeight :: get ( ) . reads_writes ( migrated, migrated) )
32+ weight = weight. saturating_add ( T :: DbWeight :: get ( ) . reads_writes ( migrated, migrated) ) ;
33+
34+ // Mark the migration as completed
35+ HasMigrationRun :: < T > :: insert ( & migration_name, true ) ;
36+ weight = weight. saturating_add ( T :: DbWeight :: get ( ) . writes ( 1 ) ) ;
37+
38+ weight
3339}
You can’t perform that action at this time.
0 commit comments