Skip to content

Commit 5489569

Browse files
authored
Merge pull request #1424 from opentensor/fix/set-subnet-volume-migration
Fix/set subnet volume migration
2 parents cbe1912 + 3e600e6 commit 5489569

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pallets/subtensor/src/migrations/migrate_subnet_volume.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
205205
// `spec_version`, and `authoring_version` are the same between Wasm and native.
206206
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
207207
// the compatible custom types.
208-
spec_version: 249,
208+
spec_version: 250,
209209
impl_version: 1,
210210
apis: RUNTIME_API_VERSIONS,
211211
transaction_version: 1,

0 commit comments

Comments
 (0)