git.delta.rocks / unique-network / refs/commits / 5812736454e2

difftreelog

fix CrossAccountId sponsoring

Yaroslav Bolyukin2022-03-30parent: #3f83595.patch.diff
in: master

3 files changed

modifiedCargo.lockdiffbeforeafterboth
8706 "derivative",8706 "derivative",
8707 "fp-rpc",8707 "fp-rpc",
8708 "fp-self-contained",8708 "fp-self-contained",
8709 "frame-benchmarking",
8710 "frame-executive",8709 "frame-executive",
8711 "frame-support",8710 "frame-support",
8712 "frame-system",8711 "frame-system",
8713 "frame-system-benchmarking",
8714 "frame-system-rpc-runtime-api",8712 "frame-system-rpc-runtime-api",
8715 "hex-literal",
8716 "orml-vesting",8713 "orml-vesting",
8717 "pallet-aura",8714 "pallet-aura",
8718 "pallet-balances",8715 "pallet-balances",
modifiedpallets/unique/src/eth/sponsoring.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/sponsoring.rs
+++ b/pallets/unique/src/eth/sponsoring.rs
@@ -24,7 +24,7 @@
 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;
 
@@ -60,7 +60,7 @@
 						let _token_id: TokenId = token_id.try_into().ok()?;
 						withdraw_create_item::<T>(
 							&collection,
-							who.as_sub(),
+							&who,
 							&CreateItemData::NFT(CreateNftData::default()),
 						)
 						.map(|()| sponsor)
modifiedpallets/unique/src/sponsorship.rsdiffbeforeafterboth
--- a/pallets/unique/src/sponsorship.rs
+++ b/pallets/unique/src/sponsorship.rs
@@ -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,