From 91733da0794604248a3796d5b60e57476b8d5e67 Mon Sep 17 00:00:00 2001 From: Roy Yang Date: Thu, 3 Feb 2022 14:55:56 +1300 Subject: [PATCH 1/3] Renamed the NFT trait to InspectExtended --- modules/nft/src/lib.rs | 8 +++----- runtime/common/src/precompile/nft.rs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/nft/src/lib.rs b/modules/nft/src/lib.rs index 207bb0cd8..e382e5cd8 100644 --- a/modules/nft/src/lib.rs +++ b/modules/nft/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ transactional, PalletId, }; use frame_system::pallet_prelude::*; -use orml_traits::NFT; +use orml_traits::InspectExtended; use primitives::{ nft::{Attributes, ClassProperty, NFTBalance, Properties, CID}, ReserveIdentifier, @@ -506,16 +506,14 @@ impl Pallet { } } -impl NFT for Pallet { - type ClassId = ClassIdOf; - type TokenId = TokenIdOf; +impl InspectExtended for Pallet { type Balance = NFTBalance; fn balance(who: &T::AccountId) -> Self::Balance { orml_nft::TokensByOwner::::iter_prefix((who,)).count() as u128 } - fn next_token_id(class: Self::ClassId) -> Self::TokenId { + fn next_token_id(class: Self::ClassId) -> Self::InstanceId { orml_nft::Pallet::::next_token_id(class) } } diff --git a/runtime/common/src/precompile/nft.rs b/runtime/common/src/precompile/nft.rs index 2d597399f..4fc414936 100644 --- a/runtime/common/src/precompile/nft.rs +++ b/runtime/common/src/precompile/nft.rs @@ -27,7 +27,7 @@ use sp_core::H160; use sp_runtime::RuntimeDebug; use sp_std::{borrow::Cow, marker::PhantomData, prelude::*, result}; -use orml_traits::NFT as NFTT; +use orml_traits::InspectExtended; use super::input::{Input, InputT, Output}; use num_enum::{IntoPrimitive, TryFromPrimitive}; @@ -55,7 +55,7 @@ pub enum Action { impl Precompile for NFTPrecompile where Runtime: module_evm::Config + module_prices::Config + module_nft::Config, - module_nft::Pallet: NFTT + module_nft::Pallet: InspectExtended + Inspect + Transfer, { From 61e6d430050692d603d7b8765f541a405571649e Mon Sep 17 00:00:00 2001 From: Roy Yang Date: Thu, 3 Feb 2022 15:02:26 +1300 Subject: [PATCH 2/3] Updated orml reference --- orml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orml b/orml index 419ac91d7..30122ff1d 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit 419ac91d7e116765f747b3acdbf3c49502dc5d6c +Subproject commit 30122ff1d5470d94bf07bbb06ed3c3ee8ffb0501 From 315e66e0601313c6ea155d82d92c8f4bb6ef2264 Mon Sep 17 00:00:00 2001 From: Roy Yang Date: Thu, 3 Feb 2022 17:04:02 +1300 Subject: [PATCH 3/3] Update orml version --- orml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orml b/orml index 30122ff1d..6796bbd95 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit 30122ff1d5470d94bf07bbb06ed3c3ee8ffb0501 +Subproject commit 6796bbd95c5f35be1f20df18e9fd33400d8896c3