File tree Expand file tree Collapse file tree 6 files changed +55
-1
lines changed
domains/pallets/messenger/src Expand file tree Collapse file tree 6 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pub mod block_tree;
13
13
pub mod bundle_storage_fund;
14
14
pub mod domain_registry;
15
15
pub mod extensions;
16
+ pub mod migrations;
16
17
pub mod runtime_registry;
17
18
mod staking;
18
19
mod staking_epoch;
Original file line number Diff line number Diff line change
1
+ mod v1_to_v5;
2
+
3
+ pub use v1_to_v5:: VersionCheckedMigrateDomainsV1ToV5 ;
Original file line number Diff line number Diff line change
1
+ //! Migration module for pallet-domains
2
+
3
+ use crate :: { Config , Pallet } ;
4
+ use core:: marker:: PhantomData ;
5
+ use frame_support:: migrations:: VersionedMigration ;
6
+ use frame_support:: traits:: UncheckedOnRuntimeUpgrade ;
7
+ use frame_support:: weights:: Weight ;
8
+
9
+ pub type VersionCheckedMigrateDomainsV1ToV5 < T > = VersionedMigration <
10
+ 1 ,
11
+ 5 ,
12
+ VersionUncheckedMigrateV1ToV5 < T > ,
13
+ Pallet < T > ,
14
+ <T as frame_system:: Config >:: DbWeight ,
15
+ > ;
16
+
17
+ pub struct VersionUncheckedMigrateV1ToV5 < T > ( PhantomData < T > ) ;
18
+ impl < T : Config > UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV1ToV5 < T > {
19
+ fn on_runtime_upgrade ( ) -> Weight {
20
+ Weight :: zero ( )
21
+ }
22
+ }
Original file line number Diff line number Diff line change @@ -1100,7 +1100,11 @@ pub type Executive = frame_executive::Executive<
1100
1100
Runtime ,
1101
1101
AllPalletsWithSystem ,
1102
1102
// TODO: remove only after migrations are run on Mainnet
1103
- pallet_messenger:: migrations:: VersionCheckedMigrateDomainsV1ToV2 < Runtime > ,
1103
+ (
1104
+ pallet_domains:: migrations:: VersionCheckedMigrateDomainsV1ToV5 < Runtime > ,
1105
+ pallet_messenger:: migrations:: VersionCheckedMigrateDomainsV0ToV1 < Runtime > ,
1106
+ pallet_messenger:: migrations:: VersionCheckedMigrateDomainsV1ToV2 < Runtime > ,
1107
+ ) ,
1104
1108
> ;
1105
1109
1106
1110
impl pallet_subspace:: extensions:: MaybeSubspaceCall < Runtime > for RuntimeCall {
Original file line number Diff line number Diff line change
1
+ mod v0_to_v1;
1
2
mod v1_to_v2;
2
3
4
+ pub use v0_to_v1:: VersionCheckedMigrateDomainsV0ToV1 ;
3
5
pub ( crate ) use v1_to_v2:: migrate_channels:: { get_channel, get_open_channels} ;
4
6
pub use v1_to_v2:: VersionCheckedMigrateDomainsV1ToV2 ;
Original file line number Diff line number Diff line change
1
+ //! Migration module for pallet-messenger
2
+
3
+ use crate :: { Config , Pallet } ;
4
+ use core:: marker:: PhantomData ;
5
+ use frame_support:: migrations:: VersionedMigration ;
6
+ use frame_support:: traits:: UncheckedOnRuntimeUpgrade ;
7
+ use frame_support:: weights:: Weight ;
8
+
9
+ pub type VersionCheckedMigrateDomainsV0ToV1 < T > = VersionedMigration <
10
+ 0 ,
11
+ 1 ,
12
+ VersionUncheckedMigrateV0ToV1 < T > ,
13
+ Pallet < T > ,
14
+ <T as frame_system:: Config >:: DbWeight ,
15
+ > ;
16
+
17
+ pub struct VersionUncheckedMigrateV0ToV1 < T > ( PhantomData < T > ) ;
18
+ impl < T : Config > UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateV0ToV1 < T > {
19
+ fn on_runtime_upgrade ( ) -> Weight {
20
+ Weight :: zero ( )
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments