Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
e7003fd
feat(frame-support): add asset ops
mrshiposha Apr 25, 2024
6c6cf4b
feat(pallet-uniques): implement asset ops
mrshiposha Apr 25, 2024
a2099c0
feat(xcm): add unique instances adapters using asset ops
mrshiposha Apr 25, 2024
3f7c3a2
feat(rococo,westend): use xcm unique instances adapter
mrshiposha Apr 25, 2024
21323ff
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Apr 26, 2024
2db1903
Merge branch 'master' into feature/asset-ops-traits
mrshiposha May 28, 2024
0016ec2
refactor: asset-ops related stuff, add Stash+Restore ops
mrshiposha Jun 11, 2024
17f54ab
refactor: unique instances XCM stuff
mrshiposha Jun 11, 2024
a725bbd
fix: add derives to NonFungibleAsset
mrshiposha Jun 11, 2024
b4893df
chore: remove unneeded
mrshiposha Jun 11, 2024
105ebfa
feat: add derives to id assignments
mrshiposha Jun 12, 2024
379d6cd
refactor(asset-ops): lifetimes in common strategies
mrshiposha Jun 13, 2024
d28ad75
refactor: xcm unique-instances derivatives traits
mrshiposha Jun 15, 2024
c45c7ca
refactor: id assignment
mrshiposha Jun 24, 2024
a5b1b1c
fix: remove unneeded imports
mrshiposha Jun 25, 2024
be99d8e
feat: add pallet-xnft
mrshiposha Jun 25, 2024
ae08d7e
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Jun 27, 2024
6e06663
fix(xcm-builder): remove unneeded uses, add mod doc comment
mrshiposha Jun 27, 2024
aa2f827
fix(asset-ops): doc comment
mrshiposha Jun 27, 2024
79cae0a
fix: add pallet-xnft to workspace
mrshiposha Jun 27, 2024
4c7a0ca
fix: add Success type to all strategies
mrshiposha Jun 27, 2024
4585528
chore: cargo fmt
mrshiposha Jun 27, 2024
5324c5b
fix: impl StashStrategy,RestoreStrategy for WithOrigin
mrshiposha Jun 27, 2024
8f94c1d
fix: CI errors
mrshiposha Jul 3, 2024
23c36be
fix: remove unused imports
mrshiposha Jul 3, 2024
845149a
fix: clippy
mrshiposha Jul 3, 2024
f7e2c3e
fix: clippy
mrshiposha Jul 3, 2024
ce0b2e3
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Jul 15, 2024
d30a218
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Aug 5, 2024
d870d91
fix: cargo fmt, remove unneeded use
mrshiposha Aug 5, 2024
1a50904
fix: umbrella crate
mrshiposha Aug 5, 2024
cd24f76
refactor: replace pallet-xnft with pallet-derivatives
mrshiposha Sep 19, 2024
c1ff41e
refactor: simplify unique instances derivatives types
mrshiposha Sep 19, 2024
7bfb0fd
refactor: remove RegisterOnCreate/DeregisterOnDestroy
mrshiposha Sep 19, 2024
1b90a48
refactor: use result type in all registry's methods
mrshiposha Sep 19, 2024
15c0c53
feat: add AssetIdOf
mrshiposha Sep 19, 2024
a7e1809
refactor: use options to get original/derivative
mrshiposha Sep 20, 2024
a71ecad
feat: add IterDerivativesRegistry
mrshiposha Oct 11, 2024
df878fd
fix: remove unneeded imports
mrshiposha Oct 13, 2024
c45b442
refactor: remove AssetKind notion
mrshiposha Oct 24, 2024
44a2366
refactor: remove AssetKind notion from xcm adapters
mrshiposha Oct 24, 2024
1f050ea
fix: fmt uniques asset-ops
mrshiposha Oct 24, 2024
53c24d9
fix: fmt unique-instances xcm adapter
mrshiposha Oct 24, 2024
80385b9
refactor: derivatives traits and pallet
mrshiposha Oct 25, 2024
f47c741
fix: add derives for common create strategies
mrshiposha Oct 25, 2024
90c9fd9
refactor(pallet-derivatives): split derivative ops
mrshiposha Oct 29, 2024
0028956
chore: remove traits already added to master
mrshiposha Apr 29, 2025
d3c403e
fix: make adapters the most recent asset-ops version
mrshiposha Apr 29, 2025
5734cec
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Apr 29, 2025
18668d2
fix: minor fix after merge
mrshiposha Apr 29, 2025
d31ccca
refactor and add docs
mrshiposha May 28, 2025
61cad9a
feat: make DeriveAndReportId a create strategy
mrshiposha May 28, 2025
105fdc1
feat: asset-ops utils
mrshiposha May 28, 2025
b561a22
feat: add FallibleConvert
mrshiposha May 28, 2025
20a4219
test: pallet-derivatives mock and tests
mrshiposha May 28, 2025
ade84f0
chore: cargo fmt
mrshiposha May 28, 2025
15e8076
fix benchmarks, use separate ensureorigins for create,destroy
mrshiposha May 28, 2025
aca340c
Update polkadot/xcm/pallet-derivatives/src/lib.rs
mrshiposha Jun 19, 2025
5ee9516
Update polkadot/xcm/pallet-derivatives/src/lib.rs
mrshiposha Jun 19, 2025
cd4df12
fixes after review
mrshiposha Jul 3, 2025
b1790c0
Cleaning ExtractAssetId and ops.rs - part1
bkontur Jul 31, 2025
80f001b
Rename UniqueInstancesOps -> CombinedAssetOps
bkontur Jul 31, 2025
3c01221
Move `CombinedAssetOps` to the support common_strategies.rs
bkontur Jul 31, 2025
015a3a7
Rename `UniqueInstancesWithStashAccount` to `StashAccountAssetOps`
bkontur Jul 31, 2025
cff4008
Move `StashAccountAssetOps` to the common_strategies.rs
bkontur Jul 31, 2025
2a88bb4
Renamed AlwaysErrOps to DisabledOps
bkontur Jul 31, 2025
de9c35b
Move DeriveStrategyThenCreate
bkontur Jul 31, 2025
6a720f3
More moving stuff
bkontur Jul 31, 2025
01695ad
Remove FallibleConvert / AsFallibleConvert
bkontur Jul 31, 2025
574e7e6
Update substrate/frame/derivatives/src/mock/mod.rs
mrshiposha Jul 31, 2025
c6165d1
Update substrate/frame/derivatives/src/mock/mod.rs
mrshiposha Jul 31, 2025
7c2a726
Merge pull request #14 from bkontur/bko-on-asset-ops-traits
mrshiposha Jul 31, 2025
646f660
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Jul 31, 2025
91672f5
fix: pallet-derivative tests after master merge
mrshiposha Jul 31, 2025
7de250d
fix: Cargo.lock after master merge
mrshiposha Jul 31, 2025
2a6f3dc
chore: cargo fmt
mrshiposha Jul 31, 2025
f12605b
Update substrate/frame/derivatives/src/mock/auto_id_nfts.rs
mrshiposha Aug 1, 2025
8e12f0e
Update substrate/frame/derivatives/src/tests.rs
mrshiposha Aug 1, 2025
56c04fb
Update cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_c…
mrshiposha Aug 1, 2025
7911193
Update substrate/frame/derivatives/src/tests.rs
mrshiposha Aug 1, 2025
3023097
Update substrate/frame/derivatives/Cargo.toml
mrshiposha Aug 1, 2025
044b106
Update substrate/frame/derivatives/Cargo.toml
mrshiposha Aug 1, 2025
172dfef
Update substrate/frame/derivatives/src/tests.rs
mrshiposha Aug 1, 2025
ba56065
Update substrate/frame/derivatives/Cargo.toml
mrshiposha Aug 1, 2025
9a893e1
Fix zepter/taplo
bkontur Aug 1, 2025
0504de5
chore: add prdoc
mrshiposha Aug 1, 2025
28dc3c4
Merge pull request #15 from bkontur/bko-on-asset-ops-traits
mrshiposha Aug 1, 2025
bc7d984
fix(pallet-derivatives): markdownlint
mrshiposha Aug 1, 2025
c22e07b
fix(pallet-derivatives): docs
mrshiposha Aug 1, 2025
2987a63
chore: cargo fmt
mrshiposha Aug 1, 2025
49c7397
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Aug 1, 2025
d87c1bb
chore: cargo fmt
mrshiposha Aug 1, 2025
043bc69
fix: apply umbrella patch
mrshiposha Aug 1, 2025
3657ede
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Aug 5, 2025
c9d5cbf
doc: add convention comment
mrshiposha Aug 5, 2025
145475f
test(asset-hub-westend): new NFT adapter works as the old one for res…
mrshiposha Aug 6, 2025
e4a69dd
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Aug 6, 2025
fc137c3
fix: pallet-uniques tests
mrshiposha Aug 6, 2025
4c69a1f
Merge branch 'master' into feature/asset-ops-traits
mrshiposha Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ members = [
"substrate/frame/core-fellowship",
"substrate/frame/delegated-staking",
"substrate/frame/democracy",
"substrate/frame/derivatives",
"substrate/frame/dummy-dim",
"substrate/frame/election-provider-multi-block",
"substrate/frame/election-provider-multi-phase",
Expand Down Expand Up @@ -1051,6 +1052,7 @@ pallet-staking-runtime-api = { path = "substrate/frame/staking/runtime-api", def
revive-dev-node = { path = "substrate/frame/revive/dev-node/node" }
revive-dev-runtime = { path = "substrate/frame/revive/dev-node/runtime" }
# TODO: remove the reward stuff as they are not needed here
pallet-derivatives = { path = "polkadot/xcm/pallet-derivatives", default-features = false }
pallet-staking-async = { path = "substrate/frame/staking-async", default-features = false }
pallet-staking-async-ah-client = { path = "substrate/frame/staking-async/ah-client", default-features = false }
pallet-staking-async-parachain-runtime = { path = "substrate/frame/staking-async/runtimes/parachain" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ use testnet_parachains_constants::rococo::snowbridge::{
};
use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm_builder::{
AccountId32Aliases, AliasChildLocation, AllowExplicitUnpaidExecutionFrom,
AllowHrmpNotificationsFromRelayChain, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry,
DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, ExternalConsensusLocationsConverterFor,
unique_instances::UniqueInstancesAdapter, AccountId32Aliases, AliasChildLocation,
AllowExplicitUnpaidExecutionFrom, AllowHrmpNotificationsFromRelayChain,
AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom,
DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal,
DescribeFamily, EnsureXcmOrigin, ExternalConsensusLocationsConverterFor,
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, HashedDescription, IsConcrete,
LocalMint, MatchedConvertedConcreteId, NetworkExportTableItem, NoChecking, NonFungiblesAdapter,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SendXcmFeeToAccount,
LocalMint, MatchInClassInstances, MatchedConvertedConcreteId, NetworkExportTableItem,
NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SendXcmFeeToAccount,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SingleAssetExchangeAdapter, SovereignPaidRemoteExporter,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
Expand Down Expand Up @@ -147,19 +148,11 @@ pub type UniquesConvertedConcreteId =
assets_common::UniquesConvertedConcreteId<UniquesPalletLocation>;

/// Means for transacting unique assets.
pub type UniquesTransactor = NonFungiblesAdapter<
// Use this non-fungibles implementation:
Uniques,
// This adapter will handle any non-fungible asset from the uniques pallet.
UniquesConvertedConcreteId,
// Convert an XCM Location into a local account id:
LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
pub type UniquesTransactor = UniqueInstancesAdapter<
AccountId,
// Does not check teleports.
NoChecking,
// The account to use for tracking teleports.
CheckingAccount,
LocationToAccountId,
MatchInClassInstances<UniquesConvertedConcreteId>,
pallet_uniques::asset_ops::Item<Uniques>,
>;

/// `AssetId`/`Balance` converter for `ForeignAssets`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ use westend_runtime_constants::{
};
use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm_builder::{
AccountId32Aliases, AliasChildLocation, AllowExplicitUnpaidExecutionFrom,
AllowHrmpNotificationsFromRelayChain, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry,
DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, ExternalConsensusLocationsConverterFor,
unique_instances::UniqueInstancesAdapter, AccountId32Aliases, AliasChildLocation,
AllowExplicitUnpaidExecutionFrom, AllowHrmpNotificationsFromRelayChain,
AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom,
DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal,
DescribeFamily, EnsureXcmOrigin, ExternalConsensusLocationsConverterFor,
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, HashedDescription, IsConcrete,
LocalMint, MatchedConvertedConcreteId, MintLocation, NetworkExportTableItem, NoChecking,
NonFungiblesAdapter, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset,
LocalMint, MatchInClassInstances, MatchedConvertedConcreteId, MintLocation,
NetworkExportTableItem, NoChecking, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SendXcmFeeToAccount, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SingleAssetExchangeAdapter,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
Expand Down Expand Up @@ -143,19 +144,11 @@ pub type UniquesConvertedConcreteId =
assets_common::UniquesConvertedConcreteId<UniquesPalletLocation>;

/// Means for transacting unique assets.
pub type UniquesTransactor = NonFungiblesAdapter<
// Use this non-fungibles implementation:
Uniques,
// This adapter will handle any non-fungible asset from the uniques pallet.
UniquesConvertedConcreteId,
// Convert an XCM Location into a local account id:
LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
pub type UniquesTransactor = UniqueInstancesAdapter<
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change? Is the behavior different than before?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 you added tests to check the behavior is the same

AccountId,
// Does not check teleports.
NoChecking,
// The account to use for tracking teleports.
CheckingAccount,
LocationToAccountId,
MatchInClassInstances<UniquesConvertedConcreteId>,
pallet_uniques::asset_ops::Item<Uniques>,
>;

/// `AssetId`/`Balance` converter for `ForeignAssets`.
Expand Down
179 changes: 174 additions & 5 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ use asset_hub_westend_runtime::{
governance, xcm_config,
xcm_config::{
bridging, CheckingAccount, LocationToAccountId, StakingPot,
TrustBackedAssetsPalletLocation, WestendLocation, XcmConfig,
TrustBackedAssetsPalletLocation, UniquesConvertedConcreteId, UniquesPalletLocation,
WestendLocation, XcmConfig,
},
AllPalletsWithoutSystem, Assets, Balances, Block, ExistentialDeposit, ForeignAssets,
ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem,
PolkadotXcm, Revive, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys,
ToRococoXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue,
ToRococoXcmRouterInstance, TrustBackedAssetsInstance, Uniques, XcmpQueue,
};
pub use asset_hub_westend_runtime::{AssetConversion, AssetDeposit, CollatorSelection, System};
use asset_test_utils::{
Expand All @@ -45,6 +46,10 @@ use frame_support::{
fungibles::{
self, Create, Inspect as FungiblesInspect, InspectEnumerable, Mutate as FungiblesMutate,
},
tokens::asset_ops::{
common_strategies::{Bytes, Owner},
Inspect as InspectUniqueAsset,
},
ContainsPair,
},
weights::{Weight, WeightToFee as WeightToFeeT},
Expand All @@ -55,10 +60,11 @@ use pallet_revive::{
Code, DepositLimit,
};
use pallet_revive_fixtures::compile_module;
use pallet_uniques::{asset_ops::Item, asset_strategies::Attribute};
use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance};
use sp_consensus_aura::SlotDuration;
use sp_core::crypto::Ss58Codec;
use sp_runtime::{traits::MaybeEquivalence, Either};
use sp_runtime::{traits::MaybeEquivalence, Either, MultiAddress};
use std::convert::Into;
use testnet_parachains_constants::westend::{consensus::*, currency::UNITS, fee::WeightToFee};
use xcm::{
Expand All @@ -68,8 +74,11 @@ use xcm::{
},
VersionedXcm,
};
use xcm_builder::WithLatestLocationConverter;
use xcm_executor::traits::{ConvertLocation, JustTry, WeightTrader};
use xcm_builder::{
unique_instances::UniqueInstancesAdapter as NewNftAdapter, MatchInClassInstances, NoChecking,
NonFungiblesAdapter as OldNftAdapter, WithLatestLocationConverter,
};
use xcm_executor::traits::{ConvertLocation, JustTry, TransactAsset, WeightTrader};
use xcm_runtime_apis::conversions::LocationToAccountHelper;

const ALICE: [u8; 32] = [1u8; 32];
Expand Down Expand Up @@ -503,6 +512,166 @@ fn test_asset_xcm_take_first_trader_not_possible_for_non_sufficient_assets() {
});
}

fn test_nft_asset_transactor_works<T: TransactAsset>() {
ExtBuilder::<Runtime>::default()
.with_tracing()
.with_collators(vec![AccountId::from(ALICE)])
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
let collection_id = 42;
let item_id = 101;

let alice = AccountId::from(ALICE);
let bob = AccountId::from(BOB);
let ctx = XcmContext { origin: None, message_id: XcmHash::default(), topic: None };

assert_ok!(Balances::mint_into(&alice, 2 * UNITS));

assert_ok!(Uniques::create(
RuntimeHelper::origin_of(alice.clone()),
collection_id,
MultiAddress::Id(alice.clone()),
));

assert_ok!(Uniques::mint(
RuntimeHelper::origin_of(alice.clone()),
collection_id,
item_id,
MultiAddress::Id(bob.clone()),
));

let attr_key = vec![0xA, 0xA, 0xB, 0xB];
let attr_value = vec![0xC, 0x0, 0x0, 0x1, 0xF, 0x0, 0x0, 0xD];

assert_ok!(Uniques::set_attribute(
RuntimeHelper::origin_of(alice.clone()),
collection_id,
Some(item_id),
attr_key.clone().try_into().unwrap(),
attr_value.clone().try_into().unwrap(),
));

let collection_location = UniquesPalletLocation::get()
.appended_with(GeneralIndex(collection_id.into()))
.unwrap();
let item_asset: Asset =
(collection_location, AssetInstance::Index(item_id.into())).into();

let alice_account_location: Location = alice.clone().into();
let bob_account_location: Location = bob.clone().into();

// Can't deposit the token that isn't withdrawn
assert_err!(
T::deposit_asset(&item_asset, &alice_account_location, Some(&ctx),),
XcmError::FailedToTransactAsset("AlreadyExists")
);

// Alice isn't the owner, she can't withdraw the token
assert_noop!(
T::withdraw_asset(&item_asset, &alice_account_location, Some(&ctx),),
XcmError::FailedToTransactAsset("NoPermission")
);

// Bob, the owner, can withdraw the token
assert_ok!(T::withdraw_asset(&item_asset, &bob_account_location, Some(&ctx),));

// The token is withdrawn
assert_eq!(
Item::<Uniques>::inspect(&(collection_id, item_id), Owner::default()),
Err(pallet_uniques::Error::<Runtime>::UnknownItem.into()),
);

// But the attribute data is preserved as the pallet-uniques works that way.
assert_eq!(
Item::<Uniques>::inspect(
&(collection_id, item_id),
Bytes(Attribute(attr_key.as_slice()))
),
Ok(attr_value.clone()),
);

// Can't withdraw the already withdrawn token
assert_err!(
T::withdraw_asset(&item_asset, &bob_account_location, Some(&ctx),),
XcmError::FailedToTransactAsset("UnknownCollection")
);

// Deposit the token to alice
assert_ok!(T::deposit_asset(&item_asset, &alice_account_location, Some(&ctx),));

// The token is deposited
assert_eq!(
Item::<Uniques>::inspect(&(collection_id, item_id), Owner::default()),
Ok(alice.clone()),
);

// The attribute data is the same
assert_eq!(
Item::<Uniques>::inspect(
&(collection_id, item_id),
Bytes(Attribute(attr_key.as_slice()))
),
Ok(attr_value.clone()),
);

// Can't deposit the token twice
assert_err!(
T::deposit_asset(&item_asset, &alice_account_location, Some(&ctx),),
XcmError::FailedToTransactAsset("AlreadyExists")
);

// Transfer the token directly
assert_ok!(T::transfer_asset(
&item_asset,
&alice_account_location,
&bob_account_location,
&ctx,
));

// The token's owner has changed
assert_eq!(
Item::<Uniques>::inspect(&(collection_id, item_id), Owner::default()),
Ok(bob.clone()),
);

// The attribute data is the same
assert_eq!(
Item::<Uniques>::inspect(
&(collection_id, item_id),
Bytes(Attribute(attr_key.as_slice()))
),
Ok(attr_value.clone()),
);
});
}

#[test]
fn test_new_nft_config_works_as_the_old_one() {
type OldNftTransactor = OldNftAdapter<
Uniques,
UniquesConvertedConcreteId,
LocationToAccountId,
AccountId,
NoChecking,
CheckingAccount,
>;

type NewNftTransactor = NewNftAdapter<
AccountId,
LocationToAccountId,
MatchInClassInstances<UniquesConvertedConcreteId>,
Item<Uniques>,
>;

test_nft_asset_transactor_works::<OldNftTransactor>();
test_nft_asset_transactor_works::<NewNftTransactor>();
}

#[test]
fn test_assets_balances_api_works() {
use assets_common::runtime_api::runtime_decl_for_fungibles_api::FungiblesApi;
Expand Down
Loading
Loading