Skip to content

Commit f25bdda

Browse files
committed
clear map before rest of migration
1 parent 8f6e8d6 commit f25bdda

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pallets/subtensor/src/migration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ pub fn do_migrate_fix_total_coldkey_stake<T: Config>() -> Weight {
3737
// Initialize the weight with one read operation.
3838
let mut weight = T::DbWeight::get().reads(1);
3939

40+
// Clear everything from the map first
41+
let _ = TotalColdkeyStake::<T>::clear(u32::MAX, None);
42+
4043
// Iterate through all staking hotkeys.
4144
for (coldkey, hotkey_vec) in StakingHotkeys::<T>::iter() {
4245
// Init the zero value.

0 commit comments

Comments
 (0)