difftreelog
Merge pull request #920 from UniqueNetwork/fix/on-runtime-upgrade
in: master
9 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5996,7 +5996,7 @@
[[package]]
name = "pallet-app-promotion"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"frame-benchmarking",
"frame-support",
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -167,6 +167,8 @@
.map(|k| (k, 1 << 100))
.collect(),
},
+ common: Default::default(),
+ nonfungible: Default::default(),
treasury: Default::default(),
tokens: TokensConfig { balances: vec![] },
sudo: SudoConfig {
@@ -225,6 +227,8 @@
.expect("WASM binary was not build, please build it!")
.to_vec(),
},
+ common: Default::default(),
+ nonfungible: Default::default(),
balances: BalancesConfig {
balances: $endowed_accounts
.iter()
pallets/app-promotion/CHANGELOG.mddiffbeforeafterboth--- a/pallets/app-promotion/CHANGELOG.md
+++ b/pallets/app-promotion/CHANGELOG.md
@@ -3,6 +3,11 @@
All notable changes to this project will be documented in this file.
<!-- bureaucrate goes here -->
+## [0.1.6] - 2023-04-19
+
+- ### Fixed
+
+- Useless `on_runtime_upgrade()` has been removed
## [0.1.5] - 2023-02-14
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -9,7 +9,7 @@
license = 'GPLv3'
name = 'pallet-app-promotion'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.5'
+version = '0.1.6'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -263,10 +263,6 @@
pub type PreviousCalculatedRecord<T: Config> =
StorageValue<Value = (T::AccountId, T::BlockNumber), QueryKind = OptionQuery>;
- #[pallet::storage]
- pub(crate) type UpgradedToReserves<T: Config> =
- StorageValue<Value = bool, QueryKind = ValueQuery>;
-
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
/// Block overflow is impossible due to the fact that the unstake algorithm in on_initialize
@@ -289,12 +285,6 @@
}
<T as Config>::WeightInfo::on_initialize(counter)
- }
-
- fn on_runtime_upgrade() -> Weight {
- <UpgradedToReserves<T>>::kill();
-
- T::DbWeight::get().reads_writes(0, 1)
}
}
pallets/common/CHANGELOG.mddiffbeforeafterboth1# Change Log23All notable changes to this project will be documented in this file.45<!-- bureaucrate goes here -->67## [0.1.14] - 2023-03-2889### Added1011- Added benchmark to check if user is contained in AllowList (`check_accesslist()`).1213## [0.1.13] - 2023-01-201415### Changed1617- Behavior of the `CommonWeightInfo::create_item` method.1819## [0.1.12] - 2022-11-162021### Changed2223- Behavior of the `setCollectionLimit` method.24 Removed method overload: single signature `(string, uint256)`25 is used for both cases.2627## [0.1.11] - 2022-11-122829### Changed3031- In the `Collection` solidity interface,32 the `allowed` function has been renamed to `allow_listed_cross`.33 Also `EthCrossAccount` type is now used as `user` arg.3435## [0.1.10] - 2022-11-023637### Changed3839- Use named structure `EthCrossAccount` in eth functions.4041## [0.1.9] - 2022-10-134243## Added4445- EVM event for `destroy_collection`.4647## [0.1.8] - 2022-08-244849## Added5051- Eth methods for collection52 - set_collection_sponsor_substrate53 - has_collection_pending_sponsor54 - remove_collection_sponsor55 - get_collection_sponsor56- Add convert function from `uint256` to `CrossAccountId`.5758## [0.1.7] - 2022-08-195960### Added6162- Add convert funtion from `CrossAccountId` to eth `uint256`.6364## [0.1.6] - 2022-08-166566### Added6768- New Ethereum API methods: changeOwner, changeOwner(Substrate) and verifyOwnerOrAdmin(Substrate).6970## [v0.1.5] 2022-08-167172### Other changes7374- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a7576- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf87778- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d9757980New methods allows to call `remove_prefix` with limit multiple times81in the same block82However, we don't use prefix removal limits, so upgrade is83straightforward8485Upstream-Change: https://github.com/paritytech/substrate/pull/114908687- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b8889## [0.1.3] - 2022-07-259091### Add9293- Some static property keys and values.9495## [0.1.2] - 2022-07-209697### Fixed9899- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid100 mutability modifiers, causing invalid stub/abi generation.101102## [0.1.1] - 2022-07-14103104### Added105106- Implementation of RPC method `token_owners` returning 10 owners in no particular order.107 This was an internal request to improve the web interface and support fractionalization event.1# Change Log23All notable changes to this project will be documented in this file.45<!-- bureaucrate goes here -->6## [0.1.14] - 2023-04-1978- ### Fixed910- Useless `on_runtime_upgrade()` has been removed1112## [0.1.14] - 2023-03-281314### Added1516- Added benchmark to check if user is contained in AllowList (`check_accesslist()`).1718## [0.1.13] - 2023-01-201920### Changed2122- Behavior of the `CommonWeightInfo::create_item` method.2324## [0.1.12] - 2022-11-162526### Changed2728- Behavior of the `setCollectionLimit` method.29 Removed method overload: single signature `(string, uint256)`30 is used for both cases.3132## [0.1.11] - 2022-11-123334### Changed3536- In the `Collection` solidity interface,37 the `allowed` function has been renamed to `allow_listed_cross`.38 Also `EthCrossAccount` type is now used as `user` arg.3940## [0.1.10] - 2022-11-024142### Changed4344- Use named structure `EthCrossAccount` in eth functions.4546## [0.1.9] - 2022-10-134748## Added4950- EVM event for `destroy_collection`.5152## [0.1.8] - 2022-08-245354## Added5556- Eth methods for collection57 - set_collection_sponsor_substrate58 - has_collection_pending_sponsor59 - remove_collection_sponsor60 - get_collection_sponsor61- Add convert function from `uint256` to `CrossAccountId`.6263## [0.1.7] - 2022-08-196465### Added6667- Add convert funtion from `CrossAccountId` to eth `uint256`.6869## [0.1.6] - 2022-08-167071### Added7273- New Ethereum API methods: changeOwner, changeOwner(Substrate) and verifyOwnerOrAdmin(Substrate).7475## [v0.1.5] 2022-08-167677### Other changes7879- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a8081- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf88283- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d9758485New methods allows to call `remove_prefix` with limit multiple times86in the same block87However, we don't use prefix removal limits, so upgrade is88straightforward8990Upstream-Change: <https://github.com/paritytech/substrate/pull/11490>9192- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b9394## [0.1.3] - 2022-07-259596### Add9798- Some static property keys and values.99100## [0.1.2] - 2022-07-20101102### Fixed103104- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid105 mutability modifiers, causing invalid stub/abi generation.106107## [0.1.1] - 2022-07-14108109### Added110111- Implementation of RPC method `token_owners` returning 10 owners in no particular order.112 This was an internal request to improve the web interface and support fractionalization event.pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -420,10 +420,11 @@
#[frame_support::pallet]
pub mod pallet {
+ use core::marker::PhantomData;
+
use super::*;
use dispatch::CollectionDispatch;
use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion};
- use frame_system::pallet_prelude::*;
use frame_support::traits::Currency;
use up_data_structs::{TokenId, mapping::TokenAddressMapping};
use scale_info::TypeInfo;
@@ -479,6 +480,23 @@
}
}
+ #[pallet::genesis_config]
+ pub struct GenesisConfig<T>(PhantomData<T>);
+
+ #[cfg(feature = "std")]
+ impl<T: Config> Default for GenesisConfig<T> {
+ fn default() -> Self {
+ Self(Default::default())
+ }
+ }
+
+ #[pallet::genesis_build]
+ impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
+ fn build(&self) {
+ StorageVersion::new(1).put::<Pallet<T>>();
+ }
+ }
+
impl<T: Config> Pallet<T> {
/// Helper function that handles deposit events
pub fn deposit_event(event: Event<T>) {
@@ -869,15 +887,6 @@
),
QueryKind = OptionQuery,
>;
-
- #[pallet::hooks]
- impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
- fn on_runtime_upgrade() -> Weight {
- StorageVersion::new(1).put::<Pallet<T>>();
-
- Weight::zero()
- }
- }
}
impl<T: Config> Pallet<T> {
pallets/nonfungible/CHANGELOG.mddiffbeforeafterboth--- a/pallets/nonfungible/CHANGELOG.md
+++ b/pallets/nonfungible/CHANGELOG.md
@@ -3,7 +3,12 @@
All notable changes to this project will be documented in this file.
<!-- bureaucrate goes here -->
+## [0.1.14] - 2023-04-19
+
+- ### Fixed
+- Useless `on_runtime_upgrade()` has been removed
+
## [0.1.14] - 2023-03-28
### Fixed
@@ -83,7 +88,7 @@
However, we don't use prefix removal limits, so upgrade is
straightforward
-Upstream-Change: https://github.com/paritytech/substrate/pull/11490
+Upstream-Change: <https://github.com/paritytech/substrate/pull/11490>
- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -283,13 +283,20 @@
QueryKind = ValueQuery,
>;
- /// Upgrade from the old schema to properties.
- #[pallet::hooks]
- impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
- fn on_runtime_upgrade() -> Weight {
- StorageVersion::new(1).put::<Pallet<T>>();
+ #[pallet::genesis_config]
+ pub struct GenesisConfig<T>(PhantomData<T>);
- Weight::zero()
+ #[cfg(feature = "std")]
+ impl<T: Config> Default for GenesisConfig<T> {
+ fn default() -> Self {
+ Self(Default::default())
+ }
+ }
+
+ #[pallet::genesis_build]
+ impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
+ fn build(&self) {
+ StorageVersion::new(1).put::<Pallet<T>>();
}
}
}