git.delta.rocks / unique-network / refs/commits / aba2919cb56e

difftreelog

fix(foreign-assets) put storage version in genesis config

Daniel Shiposha2024-06-03parent: #eca09a2.patch.diff
in: master

1 file changed

modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
8989
90#[frame_support::pallet]90#[frame_support::pallet]
91pub mod module {91pub mod module {
92 use frame_support::traits::BuildGenesisConfig;
92 use pallet_common::CollectionIssuer;93 use pallet_common::CollectionIssuer;
93 use up_data_structs::CollectionDescription;94 use up_data_structs::CollectionDescription;
9495
244 }245 }
245 }246 }
247
248 #[pallet::genesis_config]
249 #[derive(Default)]
250 pub struct GenesisConfig<T: Config>(PhantomData<T>);
251
252 #[pallet::genesis_build]
253 impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
254 fn build(&self) {
255 <Pallet<T>>::in_code_storage_version().put::<Pallet<T>>();
256 }
257 }
246258
247 #[pallet::hooks]259 #[pallet::hooks]
248 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {260 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
252 let fix_foreign_flag_weight = Self::fix_foreign_flag();264 let fix_foreign_flag_weight = Self::fix_foreign_flag();
253 let weight_v3_to_v4 = Self::migrate_v3_to_v4();265 let weight_v3_to_v4 = Self::migrate_v3_to_v4();
254266
255 StorageVersion::new(staging_xcm::v4::VERSION as u16).put::<Self>();267 Self::in_code_storage_version().put::<Self>();
256268
257 put_version_weight269 put_version_weight
258 .saturating_add(fix_foreign_flag_weight)270 .saturating_add(fix_foreign_flag_weight)