@@ -4,47 +4,22 @@ use frame_support::{
4
4
traits:: { OnRuntimeUpgrade , StorageVersion } ,
5
5
} ;
6
6
7
- pub mod v1 {
7
+ pub mod v2 {
8
8
use super :: * ;
9
9
10
- pub struct MigrateToV1 < T > ( sp_std:: marker:: PhantomData < T > ) ;
10
+ pub struct MigrateToV2 < T > ( sp_std:: marker:: PhantomData < T > ) ;
11
11
12
- impl < T : Config > OnRuntimeUpgrade for MigrateToV1 < T > {
12
+ impl < T : Config > OnRuntimeUpgrade for MigrateToV2 < T > {
13
13
fn on_runtime_upgrade ( ) -> frame_support:: weights:: Weight {
14
14
let on_chain_version = StorageVersion :: get :: < Pallet < T > > ( ) ;
15
- if on_chain_version != 0 {
16
- log:: info!( "Storage v1 already updated" ) ;
15
+ if on_chain_version != 1 {
16
+ log:: info!( "Storage v2 already updated" ) ;
17
17
return Weight :: zero ( ) ;
18
18
}
19
-
20
- StorageVersion :: new ( 1 ) . put :: < Pallet < T > > ( ) ;
21
-
22
- pallet_subspace:: migrations:: v15:: old_storage:: Weights :: < T > :: iter ( ) . for_each (
23
- |( netuid, uid, values) | {
24
- log:: info!( "migrating weights for netuid: {}, uid: {}" , netuid, uid) ;
25
- Weights :: < T > :: insert ( netuid, uid, values) ;
26
- } ,
27
- ) ;
28
-
29
- // Just for clarity, (although not explicitly needed)
30
- let _ =
31
- pallet_subspace:: migrations:: v15:: old_storage:: Weights :: < T > :: clear ( u32:: MAX , None ) ;
32
-
33
- log:: info!( "Migrated to v1" ) ;
34
-
19
+ crate :: UnitEmission :: < T > :: put ( 6427777777 ) ;
20
+ StorageVersion :: new ( 2 ) . put :: < Pallet < T > > ( ) ;
21
+ log:: info!( "Migrated to v2" ) ;
35
22
Weight :: zero ( )
36
23
}
37
24
}
38
25
}
39
-
40
- // // Kill all weight DEW related data
41
- // let _ = ConsensusParameters::<T>::clear(u32::MAX, None);
42
- // let _ = SubnetDecryptionData::<T>::clear(u32::MAX, None);
43
- // let _ = ConsensusParameters::<T>::clear(u32::MAX, None);
44
- // let _ = WeightEncryptionData::<T>::clear(u32::MAX, None);
45
- // let _ = DecryptedWeights::<T>::clear(u32::MAX, None);
46
- // let _ = BannedDecryptionNodes::<T>::clear(u32::MAX, None);
47
- // let _ = DecryptionNodes::<T>::kill();
48
-
49
- // let _ = WeightSettingDelegation::<T>::clear(u32::MAX, None);
50
- // let _ = Weights::<T>::clear_prefix(5, u32::MAX, None);
0 commit comments