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 {
6
6
let migration_name = b"migrate_subnet_volume" . to_vec ( ) ;
7
7
8
8
// Initialize the weight with one read operation.
9
- let weight = T :: DbWeight :: get ( ) . reads ( 1 ) ;
9
+ let mut weight = T :: DbWeight :: get ( ) . reads ( 1 ) ;
10
10
11
11
// Check if the migration has already run
12
12
if HasMigrationRun :: < T > :: get ( & migration_name) {
@@ -29,5 +29,11 @@ pub fn migrate_subnet_volume<T: Config>() -> Weight {
29
29
} ) ;
30
30
31
31
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
33
39
}
You can’t perform that action at this time.
0 commit comments