git.delta.rocks / unique-network / refs/commits / 4efe3bf847ba

difftreelog

Merge pull request #920 from UniqueNetwork/fix/on-runtime-upgrade

Yaroslav Bolyukin2023-04-20parents: #2eecdab #81e4404.patch.diff
in: master

9 files changed

modifiedCargo.lockdiffbeforeafterboth
59965996
5997[[package]]5997[[package]]
5998name = "pallet-app-promotion"5998name = "pallet-app-promotion"
5999version = "0.1.5"5999version = "0.1.6"
6000dependencies = [6000dependencies = [
6001 "frame-benchmarking",6001 "frame-benchmarking",
6002 "frame-support",6002 "frame-support",
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
167 .map(|k| (k, 1 << 100))167 .map(|k| (k, 1 << 100))
168 .collect(),168 .collect(),
169 },169 },
170 common: Default::default(),
171 nonfungible: Default::default(),
170 treasury: Default::default(),172 treasury: Default::default(),
171 tokens: TokensConfig { balances: vec![] },173 tokens: TokensConfig { balances: vec![] },
172 sudo: SudoConfig {174 sudo: SudoConfig {
225 .expect("WASM binary was not build, please build it!")227 .expect("WASM binary was not build, please build it!")
226 .to_vec(),228 .to_vec(),
227 },229 },
230 common: Default::default(),
231 nonfungible: Default::default(),
228 balances: BalancesConfig {232 balances: BalancesConfig {
229 balances: $endowed_accounts233 balances: $endowed_accounts
230 .iter()234 .iter()
modifiedpallets/app-promotion/CHANGELOG.mddiffbeforeafterboth
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
6## [0.1.6] - 2023-04-19
67
8- ### Fixed
9
10- Useless `on_runtime_upgrade()` has been removed
11
7## [0.1.5] - 2023-02-1412## [0.1.5] - 2023-02-14
813
9### Added14### Added
modifiedpallets/app-promotion/Cargo.tomldiffbeforeafterboth
9license = 'GPLv3'9license = 'GPLv3'
10name = 'pallet-app-promotion'10name = 'pallet-app-promotion'
11repository = 'https://github.com/UniqueNetwork/unique-chain'11repository = 'https://github.com/UniqueNetwork/unique-chain'
12version = '0.1.5'12version = '0.1.6'
1313
14[package.metadata.docs.rs]14[package.metadata.docs.rs]
15targets = ['x86_64-unknown-linux-gnu']15targets = ['x86_64-unknown-linux-gnu']
modifiedpallets/app-promotion/src/lib.rsdiffbeforeafterboth
263 pub type PreviousCalculatedRecord<T: Config> =263 pub type PreviousCalculatedRecord<T: Config> =
264 StorageValue<Value = (T::AccountId, T::BlockNumber), QueryKind = OptionQuery>;264 StorageValue<Value = (T::AccountId, T::BlockNumber), QueryKind = OptionQuery>;
265
266 #[pallet::storage]
267 pub(crate) type UpgradedToReserves<T: Config> =
268 StorageValue<Value = bool, QueryKind = ValueQuery>;
269265
270 #[pallet::hooks]266 #[pallet::hooks]
271 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {267 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
291 <T as Config>::WeightInfo::on_initialize(counter)287 <T as Config>::WeightInfo::on_initialize(counter)
292 }288 }
293
294 fn on_runtime_upgrade() -> Weight {
295 <UpgradedToReserves<T>>::kill();
296
297 T::DbWeight::get().reads_writes(0, 1)
298 }
299 }289 }
300290
301 #[pallet::call]291 #[pallet::call]
modifiedpallets/common/CHANGELOG.mddiffbeforeafterboth
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
6## [0.1.14] - 2023-04-19
67
8- ### Fixed
9
10- Useless `on_runtime_upgrade()` has been removed
11
7## [0.1.14] - 2023-03-2812## [0.1.14] - 2023-03-28
813
9### Added14### Added
82However, we don't use prefix removal limits, so upgrade is87However, we don't use prefix removal limits, so upgrade is
83straightforward88straightforward
8489
85Upstream-Change: https://github.com/paritytech/substrate/pull/1149090Upstream-Change: <https://github.com/paritytech/substrate/pull/11490>
8691
87- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b92- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
8893
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
420420
421#[frame_support::pallet]421#[frame_support::pallet]
422pub mod pallet {422pub mod pallet {
423 use core::marker::PhantomData;
424
423 use super::*;425 use super::*;
424 use dispatch::CollectionDispatch;426 use dispatch::CollectionDispatch;
425 use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion};427 use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion};
426 use frame_system::pallet_prelude::*;
427 use frame_support::traits::Currency;428 use frame_support::traits::Currency;
428 use up_data_structs::{TokenId, mapping::TokenAddressMapping};429 use up_data_structs::{TokenId, mapping::TokenAddressMapping};
429 use scale_info::TypeInfo;430 use scale_info::TypeInfo;
479 }480 }
480 }481 }
482
483 #[pallet::genesis_config]
484 pub struct GenesisConfig<T>(PhantomData<T>);
485
486 #[cfg(feature = "std")]
487 impl<T: Config> Default for GenesisConfig<T> {
488 fn default() -> Self {
489 Self(Default::default())
490 }
491 }
492
493 #[pallet::genesis_build]
494 impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
495 fn build(&self) {
496 StorageVersion::new(1).put::<Pallet<T>>();
497 }
498 }
481499
482 impl<T: Config> Pallet<T> {500 impl<T: Config> Pallet<T> {
483 /// Helper function that handles deposit events501 /// Helper function that handles deposit events
870 QueryKind = OptionQuery,888 QueryKind = OptionQuery,
871 >;889 >;
872
873 #[pallet::hooks]
874 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
875 fn on_runtime_upgrade() -> Weight {
876 StorageVersion::new(1).put::<Pallet<T>>();
877
878 Weight::zero()
879 }
880 }
881}890}
882891
883impl<T: Config> Pallet<T> {892impl<T: Config> Pallet<T> {
modifiedpallets/nonfungible/CHANGELOG.mddiffbeforeafterboth
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
6## [0.1.14] - 2023-04-19
67
8- ### Fixed
9
10- Useless `on_runtime_upgrade()` has been removed
11
7## [0.1.14] - 2023-03-2812## [0.1.14] - 2023-03-28
813
9### Fixed14### Fixed
83However, we don't use prefix removal limits, so upgrade is88However, we don't use prefix removal limits, so upgrade is
84straightforward89straightforward
8590
86Upstream-Change: https://github.com/paritytech/substrate/pull/1149091Upstream-Change: <https://github.com/paritytech/substrate/pull/11490>
8792
88- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b93- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
8994
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
283 QueryKind = ValueQuery,283 QueryKind = ValueQuery,
284 >;284 >;
285285
286 /// Upgrade from the old schema to properties.286 #[pallet::genesis_config]
287 pub struct GenesisConfig<T>(PhantomData<T>);
288
289 #[cfg(feature = "std")]
290 impl<T: Config> Default for GenesisConfig<T> {
291 fn default() -> Self {
292 Self(Default::default())
293 }
294 }
295
287 #[pallet::hooks]296 #[pallet::genesis_build]
288 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {297 impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
289 fn on_runtime_upgrade() -> Weight {298 fn build(&self) {
290 StorageVersion::new(1).put::<Pallet<T>>();299 StorageVersion::new(1).put::<Pallet<T>>();
291
292 Weight::zero()
293 }300 }
294 }301 }
295}302}