git.delta.rocks / unique-network / refs/commits / 73163286b889

difftreelog

Cleanup code in scheduler and rename white to allow in comments in nft

Greg Zaitsev2021-11-10parent: #dfd6dab.patch.diff
in: master

3 files changed

modifiedCargo.lockdiffbeforeafterboth
5055 "sp-transaction-pool",5055 "sp-transaction-pool",
5056 "substrate-frame-rpc-system",5056 "substrate-frame-rpc-system",
5057 "tokio 0.2.25",5057 "tokio 0.2.25",
5058 "uc-rpc",
5059 "up-rpc",
5058]5060]
50595061
5060[[package]]5062[[package]]
5082 "nft-data-structs",5084 "nft-data-structs",
5083 "pallet-aura",5085 "pallet-aura",
5084 "pallet-balances",5086 "pallet-balances",
5087 "pallet-common",
5085 "pallet-ethereum",5088 "pallet-ethereum",
5086 "pallet-evm",5089 "pallet-evm",
5087 "pallet-evm-coder-substrate",5090 "pallet-evm-coder-substrate",
5088 "pallet-evm-contract-helpers",5091 "pallet-evm-contract-helpers",
5089 "pallet-evm-migration",5092 "pallet-evm-migration",
5090 "pallet-evm-transaction-payment",5093 "pallet-evm-transaction-payment",
5094 "pallet-fungible",
5091 "pallet-inflation",5095 "pallet-inflation",
5092 "pallet-nft",5096 "pallet-nft",
5093 "pallet-nft-transaction-payment",5097 "pallet-nft-transaction-payment",
5098 "pallet-nonfungible",
5094 "pallet-randomness-collective-flip",5099 "pallet-randomness-collective-flip",
5100 "pallet-refungible",
5095 "pallet-sudo",5101 "pallet-sudo",
5096 "pallet-template-charge-transaction",5102 "pallet-template-transaction-payment",
5097 "pallet-timestamp",5103 "pallet-timestamp",
5098 "pallet-transaction-payment",5104 "pallet-transaction-payment",
5099 "pallet-transaction-payment-rpc-runtime-api",5105 "pallet-transaction-payment-rpc-runtime-api",
5121 "sp-transaction-pool",5127 "sp-transaction-pool",
5122 "sp-version",5128 "sp-version",
5123 "substrate-wasm-builder",5129 "substrate-wasm-builder",
5130 "up-rpc",
5124 "xcm",5131 "xcm",
5125 "xcm-builder",5132 "xcm-builder",
5126 "xcm-executor",5133 "xcm-executor",
5537 "sp-std",5544 "sp-std",
5538]5545]
5546
5547[[package]]
5548name = "pallet-common"
5549version = "0.1.0"
5550dependencies = [
5551 "evm-coder",
5552 "frame-support",
5553 "frame-system",
5554 "nft-data-structs",
5555 "pallet-evm",
5556 "pallet-evm-coder-substrate",
5557 "parity-scale-codec",
5558 "scale-info",
5559 "serde",
5560 "sp-core",
5561 "sp-runtime",
5562 "sp-std",
5563]
55395564
5540[[package]]5565[[package]]
5541name = "pallet-contract-helpers"5566name = "pallet-contract-helpers"
5787 "up-sponsorship",5812 "up-sponsorship",
5788]5813]
5814
5815[[package]]
5816name = "pallet-fungible"
5817version = "0.1.0"
5818dependencies = [
5819 "ethereum 0.9.0 (git+https://github.com/purestake/ethereum?branch=joshy-scale-info)",
5820 "evm-coder",
5821 "frame-benchmarking",
5822 "frame-support",
5823 "frame-system",
5824 "nft-data-structs",
5825 "pallet-common",
5826 "pallet-evm-coder-substrate",
5827 "parity-scale-codec",
5828 "scale-info",
5829 "sp-core",
5830 "sp-runtime",
5831 "sp-std",
5832]
57895833
5790[[package]]5834[[package]]
5791name = "pallet-gilt"5835name = "pallet-gilt"
5993 "hex-literal",6037 "hex-literal",
5994 "nft-data-structs",6038 "nft-data-structs",
5995 "pallet-balances",6039 "pallet-balances",
6040 "pallet-common",
5996 "pallet-ethereum",6041 "pallet-ethereum",
5997 "pallet-evm",6042 "pallet-evm",
5998 "pallet-evm-coder-substrate",6043 "pallet-evm-coder-substrate",
6044 "pallet-fungible",
6045 "pallet-nonfungible",
5999 "pallet-randomness-collective-flip",6046 "pallet-randomness-collective-flip",
6047 "pallet-refungible",
6000 "pallet-timestamp",6048 "pallet-timestamp",
6001 "pallet-transaction-payment",6049 "pallet-transaction-payment",
6002 "parity-scale-codec",6050 "parity-scale-codec",
6044 "sp-std",6092 "sp-std",
6045]6093]
6094
6095[[package]]
6096name = "pallet-nonfungible"
6097version = "0.1.0"
6098dependencies = [
6099 "ethereum 0.9.0 (git+https://github.com/purestake/ethereum?branch=joshy-scale-info)",
6100 "evm-coder",
6101 "frame-benchmarking",
6102 "frame-support",
6103 "frame-system",
6104 "nft-data-structs",
6105 "pallet-common",
6106 "pallet-evm-coder-substrate",
6107 "parity-scale-codec",
6108 "scale-info",
6109 "sp-core",
6110 "sp-runtime",
6111 "sp-std",
6112]
60466113
6047[[package]]6114[[package]]
6048name = "pallet-offences"6115name = "pallet-offences"
6127 "sp-std",6194 "sp-std",
6128]6195]
6196
6197[[package]]
6198name = "pallet-refungible"
6199version = "0.1.0"
6200dependencies = [
6201 "frame-benchmarking",
6202 "frame-support",
6203 "frame-system",
6204 "nft-data-structs",
6205 "pallet-common",
6206 "parity-scale-codec",
6207 "scale-info",
6208 "sp-core",
6209 "sp-runtime",
6210 "sp-std",
6211]
61296212
6130[[package]]6213[[package]]
6131name = "pallet-scheduler"6214name = "pallet-scheduler"
6252]6335]
62536336
6254[[package]]6337[[package]]
6255name = "pallet-template-charge-transaction"6338name = "pallet-template-transaction-payment"
6256version = "3.0.0"6339version = "3.0.0"
6257source = "git+https://github.com/UniqueNetwork/pallet-sponsoring#e5d3354ab68face1b2ef709dc7f629803f56598d"6340source = "git+https://github.com/UniqueNetwork/pallet-sponsoring#ab8b91e9350a31133f3a3e4f52a84c6de4108e95"
6258dependencies = [6341dependencies = [
6259 "frame-benchmarking",6342 "frame-benchmarking",
6260 "frame-support",6343 "frame-support",
11598source = "registry+https://github.com/rust-lang/crates.io-index"11681source = "registry+https://github.com/rust-lang/crates.io-index"
11599checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e"11682checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e"
11600dependencies = [11683dependencies = [
11601 "cfg-if 0.1.10",11684 "cfg-if 1.0.0",
11602 "rand 0.8.4",11685 "rand 0.8.4",
11603 "static_assertions",11686 "static_assertions",
11604]11687]
11609source = "registry+https://github.com/rust-lang/crates.io-index"11692source = "registry+https://github.com/rust-lang/crates.io-index"
11610checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec"11693checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec"
11694
11695[[package]]
11696name = "uc-rpc"
11697version = "0.1.0"
11698dependencies = [
11699 "jsonrpc-core",
11700 "jsonrpc-core-client",
11701 "jsonrpc-derive",
11702 "nft-data-structs",
11703 "pallet-common",
11704 "parity-scale-codec",
11705 "sp-api",
11706 "sp-blockchain",
11707 "sp-core",
11708 "sp-rpc",
11709 "sp-runtime",
11710 "up-rpc",
11711]
1161111712
11612[[package]]11713[[package]]
11613name = "ucd-trie"11714name = "ucd-trie"
11715source = "registry+https://github.com/rust-lang/crates.io-index"11816source = "registry+https://github.com/rust-lang/crates.io-index"
11716checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"11817checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
11818
11819[[package]]
11820name = "up-rpc"
11821version = "0.1.0"
11822dependencies = [
11823 "nft-data-structs",
11824 "pallet-common",
11825 "parity-scale-codec",
11826 "sp-api",
11827 "sp-core",
11828 "sp-runtime",
11829 "sp-std",
11830]
1171711831
11718[[package]]11832[[package]]
11719name = "up-sponsorship"11833name = "up-sponsorship"
11720version = "0.1.0"11834version = "0.1.0"
11721source = "git+https://github.com/UniqueNetwork/pallet-sponsoring#e5d3354ab68face1b2ef709dc7f629803f56598d"11835source = "git+https://github.com/UniqueNetwork/pallet-sponsoring#ab8b91e9350a31133f3a3e4f52a84c6de4108e95"
11722dependencies = [11836dependencies = [
11723 "impl-trait-for-tuples 0.2.1",11837 "impl-trait-for-tuples 0.2.1",
11724]11838]
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -162,7 +162,7 @@
 			0
 		}
 
-		/// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
+		/// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later.
 		///
 		/// # Permissions
 		///
@@ -262,7 +262,7 @@
 			Ok(())
 		}
 
-		/// Add an address to white list.
+		/// Add an address to allow list.
 		///
 		/// # Permissions
 		///
@@ -291,7 +291,7 @@
 			Ok(())
 		}
 
-		/// Remove an address from white list.
+		/// Remove an address from allow list.
 		///
 		/// # Permissions
 		///
@@ -320,7 +320,7 @@
 			Ok(())
 		}
 
-		/// Toggle between normal and white list access for the methods with access for `Anyone`.
+		/// Toggle between normal and allow list access for the methods with access for `Anyone`.
 		///
 		/// # Permissions
 		///
@@ -345,8 +345,8 @@
 		}
 
 		/// Allows Anyone to create tokens if:
-		/// * White List is enabled, and
-		/// * Address is added to white list, and
+		/// * Allow List is enabled, and
+		/// * Address is added to allow list, and
 		/// * This method was called with True parameter
 		///
 		/// # Permissions
@@ -514,8 +514,8 @@
 		/// * Collection Owner.
 		/// * Collection Admin.
 		/// * Anyone if
-		///     * White List is enabled, and
-		///     * Address is added to white list, and
+		///     * Allow List is enabled, and
+		///     * Address is added to allow list, and
 		///     * MintPermission is enabled (see SetMintPermission method)
 		///
 		/// # Arguments
@@ -540,8 +540,8 @@
 		/// * Collection Owner.
 		/// * Collection Admin.
 		/// * Anyone if
-		///     * White List is enabled, and
-		///     * Address is added to white list, and
+		///     * Allow List is enabled, and
+		///     * Address is added to allow list, and
 		///     * MintPermission is enabled (see SetMintPermission method)
 		///
 		/// # Arguments
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/lib.rs
+++ b/pallets/scheduler/src/lib.rs
@@ -62,7 +62,7 @@
 	traits::{Zero, One, BadOrigin, Saturating},
 };
 use frame_support::{
-	decl_module, decl_storage, decl_event, decl_error, IterableStorageMap,
+	decl_module, decl_storage, decl_event, decl_error,
 	dispatch::{Dispatchable, DispatchError, DispatchResult, Parameter},
 	traits::{
 		Get,
@@ -456,63 +456,6 @@
 }
 
 impl<T: Config> Module<T> {
-	/// Migrate storage format from V1 to V2.
-	/// Return true if migration is performed.
-	pub fn migrate_v1_to_t2() -> bool {
-		if StorageVersion::get() == Releases::V1 {
-			StorageVersion::put(Releases::V2);
-
-			Agenda::<T>::translate::<
-				Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>,
-				_,
-			>(|_, agenda| {
-				Some(
-					agenda
-						.into_iter()
-						.map(|schedule| {
-							schedule.map(|schedule| ScheduledV2 {
-								maybe_id: schedule.maybe_id,
-								priority: schedule.priority,
-								call: schedule.call,
-								maybe_periodic: schedule.maybe_periodic,
-								origin: system::RawOrigin::Root.into(),
-								_phantom: Default::default(),
-							})
-						})
-						.collect::<Vec<_>>(),
-				)
-			});
-
-			true
-		} else {
-			false
-		}
-	}
-
-	/// Helper to migrate scheduler when the pallet origin type has changed.
-	pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {
-		Agenda::<T>::translate::<
-			Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>,
-			_,
-		>(|_, agenda| {
-			Some(
-				agenda
-					.into_iter()
-					.map(|schedule| {
-						schedule.map(|schedule| Scheduled {
-							maybe_id: schedule.maybe_id,
-							priority: schedule.priority,
-							call: schedule.call,
-							maybe_periodic: schedule.maybe_periodic,
-							origin: schedule.origin.into(),
-							_phantom: Default::default(),
-						})
-					})
-					.collect::<Vec<_>>(),
-			)
-		});
-	}
-
 	fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {
 		let now = frame_system::Pallet::<T>::block_number();