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

difftreelog

Merge pull request #330 from UniqueNetwork/release-v918001

kozyrevdev2022-03-31parents: #8691db9 #bbc0e86.patch.diff
in: master
Release v918001

9 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8706,13 +8706,10 @@
  "derivative",
  "fp-rpc",
  "fp-self-contained",
- "frame-benchmarking",
  "frame-executive",
  "frame-support",
  "frame-system",
- "frame-system-benchmarking",
  "frame-system-rpc-runtime-api",
- "hex-literal",
  "orml-vesting",
  "pallet-aura",
  "pallet-balances",
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,8 +5,11 @@
     'pallets/*',
     'client/*',
     'primitives/*',
-    'runtime/*',
     'crates/*',
 ]
+exclude = [
+    "runtime/unique",
+    "runtime/quartz"
+]
 [profile.release]
 panic = 'unwind'
modifiedDockerfile-parachaindiffbeforeafterboth
--- a/Dockerfile-parachain
+++ b/Dockerfile-parachain
@@ -1,5 +1,5 @@
 # ===== Rust builder =====
-FROM phusion/baseimage:focal-1.0.0 as rust-builder
+FROM phusion/baseimage:focal-1.1.0 as rust-builder
 LABEL maintainer="Unique.Network"
 
 ARG RUST_TOOLCHAIN=nightly-2021-11-11
@@ -77,7 +77,7 @@
 
 # ===== RUN ======
 
-FROM phusion/baseimage:focal-1.0.0
+FROM phusion/baseimage:focal-1.1.0
 
 ARG PROFILE=release
 
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -72,12 +72,12 @@
 impl RuntimeIdentification for Box<dyn sc_service::ChainSpec> {
 	fn runtime_id(&self) -> RuntimeId {
 		#[cfg(feature = "unique-runtime")]
-		if self.id().starts_with("unique") {
+		if self.id().starts_with("unique") || self.id().starts_with("unq") {
 			return RuntimeId::Unique;
 		}
 
 		#[cfg(feature = "quartz-runtime")]
-		if self.id().starts_with("quartz") {
+		if self.id().starts_with("quartz") || self.id().starts_with("qtz") {
 			return RuntimeId::Quartz;
 		}
 
modifiedpallets/unique/src/eth/sponsoring.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/sponsoring.rs
+++ b/pallets/unique/src/eth/sponsoring.rs
@@ -24,11 +24,13 @@
 use up_sponsorship::SponsorshipHandler;
 use core::marker::PhantomData;
 use core::convert::TryInto;
-use up_data_structs::TokenId;
+use up_data_structs::{TokenId, CreateItemData, CreateNftData};
 use up_evm_mapping::EvmBackwardsAddressMapping;
 use pallet_common::account::CrossAccountId;
 
-use pallet_nonfungible::erc::{UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721Call};
+use pallet_nonfungible::erc::{
+	UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call,
+};
 use pallet_fungible::erc::{UniqueFungibleCall, ERC20Call};
 
 pub struct UniqueEthSponsorshipHandler<T: Config>(PhantomData<*const T>);
@@ -51,6 +53,18 @@
 						let token_id: TokenId = token_id.try_into().ok()?;
 						withdraw_transfer::<T>(&collection, &who, &token_id).map(|()| sponsor)
 					}
+					UniqueNFTCall::ERC721Mintable(
+						ERC721MintableCall::Mint { token_id, .. }
+						| ERC721MintableCall::MintWithTokenUri { token_id, .. },
+					) => {
+						let _token_id: TokenId = token_id.try_into().ok()?;
+						withdraw_create_item::<T>(
+							&collection,
+							&who,
+							&CreateItemData::NFT(CreateNftData::default()),
+						)
+						.map(|()| sponsor)
+					}
 					UniqueNFTCall::ERC721(ERC721Call::TransferFrom { token_id, from, .. }) => {
 						let token_id: TokenId = token_id.try_into().ok()?;
 						let from = T::CrossAccountId::from_eth(from);
modifiedpallets/unique/src/sponsorship.rsdiffbeforeafterboth
--- a/pallets/unique/src/sponsorship.rs
+++ b/pallets/unique/src/sponsorship.rs
@@ -103,7 +103,7 @@
 
 pub fn withdraw_create_item<T: Config>(
 	collection: &CollectionHandle<T>,
-	who: &T::AccountId,
+	who: &T::CrossAccountId,
 	_properties: &CreateItemData,
 ) -> Option<()> {
 	if _properties.data_size() as u32 > collection.limits.sponsored_data_size() {
@@ -120,14 +120,14 @@
 			CreateItemData::ReFungible(_) => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
 		});
 
-	if let Some(last_tx_block) = <CreateItemBasket<T>>::get((collection.id, &who)) {
+	if let Some(last_tx_block) = <CreateItemBasket<T>>::get((collection.id, who.as_sub())) {
 		let timeout = last_tx_block + limit.into();
 		if block_number < timeout {
 			return None;
 		}
 	}
 
-	CreateItemBasket::<T>::insert((collection.id, who.clone()), block_number);
+	CreateItemBasket::<T>::insert((collection.id, who.as_sub()), block_number);
 
 	Some(())
 }
@@ -246,7 +246,12 @@
 				..
 			} => {
 				let (sponsor, collection) = load(*collection_id)?;
-				withdraw_create_item::<T>(&collection, who, data).map(|()| sponsor)
+				withdraw_create_item::<T>(
+					&collection,
+					&T::CrossAccountId::from_sub(who.clone()),
+					data,
+				)
+				.map(|()| sponsor)
 			}
 			Call::transfer {
 				collection_id,
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -152,7 +152,7 @@
 	spec_name: create_runtime_str!(RUNTIME_NAME),
 	impl_name: create_runtime_str!(RUNTIME_NAME),
 	authoring_version: 1,
-	spec_version: 918000,
+	spec_version: 918001,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 1,
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
152 spec_name: create_runtime_str!(RUNTIME_NAME),152 spec_name: create_runtime_str!(RUNTIME_NAME),
153 impl_name: create_runtime_str!(RUNTIME_NAME),153 impl_name: create_runtime_str!(RUNTIME_NAME),
154 authoring_version: 1,154 authoring_version: 1,
155 spec_version: 918000,155 spec_version: 918001,
156 impl_version: 0,156 impl_version: 0,
157 apis: RUNTIME_API_VERSIONS,157 apis: RUNTIME_API_VERSIONS,
158 transaction_version: 1,158 transaction_version: 1,
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -151,7 +151,7 @@
 	spec_name: create_runtime_str!(RUNTIME_NAME),
 	impl_name: create_runtime_str!(RUNTIME_NAME),
 	authoring_version: 1,
-	spec_version: 918000,
+	spec_version: 918001,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 1,