Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api/nonfungibles): api + integration tests #380

Open
wants to merge 68 commits into
base: chungquantin/feat-runtime_nonfungibles
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bf343f6
chore: forked pallet nfts
chungquantin Oct 14, 2024
958b9e8
fix: formatting
chungquantin Oct 14, 2024
293b02e
feat: add nonfungibles implementation
chungquantin Oct 14, 2024
4c0acaf
chore: add nfts pallet
chungquantin Oct 14, 2024
b4420cb
feat: add new storage items to pallet-nfts
chungquantin Oct 15, 2024
0ad3e31
feat: check allowance
chungquantin Oct 16, 2024
cf363a2
test(nfts): check account balance & test total supply
chungquantin Oct 16, 2024
2449597
test(nfts): allowance works
chungquantin Oct 16, 2024
9de384e
refactor(test): check_allowance_works
chungquantin Oct 16, 2024
58d4c92
fix(nfts): cancel / approve collection transfer
chungquantin Oct 17, 2024
df1f6a6
test(nfts): cancel approval collection
chungquantin Oct 17, 2024
fea0259
test(nfts): update approval test cases
chungquantin Oct 17, 2024
84a7fe3
feat(nfts): get attribute read method
chungquantin Oct 17, 2024
1bb5a98
feat(nonfungibles + nfts): add new methods to manage attributes
chungquantin Oct 17, 2024
7bc9a11
refactor(nfts): toml lock file
chungquantin Oct 18, 2024
9a6aca0
fix(pallet-api): propagate try-runtime feature
chungquantin Oct 18, 2024
ba91629
fix(api/nonfungibles): unit tests
chungquantin Oct 18, 2024
83d86c2
test(api/nonfungibles): encoding_read_result
chungquantin Oct 18, 2024
cf9c697
refactor(api/nonfungibles): pallet tests
chungquantin Oct 18, 2024
b61c5f1
test(nonfungibles): add tests and remove collection owner read
chungquantin Oct 21, 2024
86ff5d8
chore: update pallet & runtime
chungquantin Nov 11, 2024
a651c3e
fix: becnhmark helper
chungquantin Nov 12, 2024
ae9ef78
feat: multi instances & function comments
chungquantin Nov 13, 2024
242e53b
feat(devnet): pallet nfts instance configuration
chungquantin Nov 13, 2024
c69dd85
chore: resolve feedback
chungquantin Nov 16, 2024
14c3a78
Merge branch 'chungquantin/chore-fork_pallet_nfts' into chungquantin/…
chungquantin Nov 16, 2024
5dccecb
feat(api/nonfungibles): destroy collection witness data & weights (#383)
chungquantin Nov 16, 2024
488be75
chore: rename nfts instance
chungquantin Nov 16, 2024
5dbc1b7
feat(api/nonfungibles): destroy collection witness data & weights (#383)
chungquantin Nov 16, 2024
8d557c3
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/feat-n…
chungquantin Nov 17, 2024
c553261
chore: clippy
chungquantin Nov 18, 2024
c5ecbd8
chore: forked pallet nfts
chungquantin Oct 14, 2024
9fd921a
feat: add nonfungibles api + integration tests
chungquantin Nov 13, 2024
325e8d3
chore: delete migration.rs
chungquantin Nov 18, 2024
f205909
chore: fork pallet nfts
chungquantin Nov 13, 2024
9cc20fe
chore: forked pallet nfts
chungquantin Oct 14, 2024
707bd80
fix: formatting
chungquantin Oct 14, 2024
7f5cec5
feat: add nonfungibles implementation
chungquantin Oct 14, 2024
cd84ed8
chore: add nfts pallet
chungquantin Oct 14, 2024
3fad994
feat: add new storage items to pallet-nfts
chungquantin Oct 15, 2024
bc2deee
feat: check allowance
chungquantin Oct 16, 2024
1946b15
test(nfts): check account balance & test total supply
chungquantin Oct 16, 2024
684d870
test(nfts): allowance works
chungquantin Oct 16, 2024
90ab45e
refactor(test): check_allowance_works
chungquantin Oct 16, 2024
f862516
fix(nfts): cancel / approve collection transfer
chungquantin Oct 17, 2024
7e55eb1
test(nfts): cancel approval collection
chungquantin Oct 17, 2024
af87aaf
test(nfts): update approval test cases
chungquantin Oct 17, 2024
06c0db9
feat(nfts): get attribute read method
chungquantin Oct 17, 2024
9c5eb78
feat(nonfungibles + nfts): add new methods to manage attributes
chungquantin Oct 17, 2024
9096b3f
refactor(nfts): toml lock file
chungquantin Oct 18, 2024
4334944
fix(pallet-api): propagate try-runtime feature
chungquantin Oct 18, 2024
a38fc47
fix(api/nonfungibles): unit tests
chungquantin Oct 18, 2024
a1f4468
test(api/nonfungibles): encoding_read_result
chungquantin Oct 18, 2024
80b378e
refactor(api/nonfungibles): pallet tests
chungquantin Oct 18, 2024
f3e7e4a
test(nonfungibles): add tests and remove collection owner read
chungquantin Oct 21, 2024
e0c896c
chore: update pallet & runtime
chungquantin Nov 11, 2024
f67dab1
fix: becnhmark helper
chungquantin Nov 12, 2024
a4e16e8
feat: multi instances & function comments
chungquantin Nov 13, 2024
73e1df5
feat(devnet): pallet nfts instance configuration
chungquantin Nov 13, 2024
bbb9bb4
chore: resolve feedback
chungquantin Nov 16, 2024
e07565d
feat(api/nonfungibles): destroy collection witness data & weights (#383)
chungquantin Nov 16, 2024
9dd80cc
chore: clippy
chungquantin Nov 18, 2024
73f4994
chore: taplo fmt
chungquantin Nov 18, 2024
e303439
fix: rebase & update integration tests
chungquantin Nov 18, 2024
3a396aa
Merge branch 'chungquantin/feat-nonfungibles' into chungquantin/api/f…
chungquantin Nov 18, 2024
515176c
chore: reformatting
chungquantin Nov 18, 2024
e836ccb
chore: feature gating integration tests
chungquantin Nov 19, 2024
5922550
Merge branch 'chungquantin/feat-runtime_nonfungibles' into chungquant…
chungquantin Nov 19, 2024
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
2 changes: 1 addition & 1 deletion Cargo.lock

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

38 changes: 8 additions & 30 deletions pallets/api/src/nonfungibles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,18 @@
CollectionSetting, CollectionSettings, DestroyWitness, ItemDeposit, ItemDetails, ItemMetadata,
ItemSetting, MintSettings, MintType, MintWitness,
};
use sp_runtime::traits::StaticLookup;
use sp_runtime::{traits::StaticLookup, BoundedVec};
use types::*;
use weights::WeightInfo;

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
#[cfg(test)]
mod tests;
pub mod types;

Check warning on line 22 in pallets/api/src/nonfungibles/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a module

warning: missing documentation for a module --> pallets/api/src/nonfungibles/mod.rs:22:1 | 22 | pub mod types; | ^^^^^^^^^^^^^
pub mod weights;

type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
type NftsOf<T> = pallet_nfts::Pallet<T, NftsInstanceOf<T>>;
type NftsErrorOf<T> = pallet_nfts::Error<T, NftsInstanceOf<T>>;
type NftsWeightInfoOf<T> = <T as pallet_nfts::Config<NftsInstanceOf<T>>>::WeightInfo;
type NftsInstanceOf<T> = <T as Config>::NftsInstance;
type BalanceOf<T> = <<T as pallet_nfts::Config<NftsInstanceOf<T>>>::Currency as Currency<
<T as frame_system::Config>::AccountId,
>>::Balance;
type CollectionIdOf<T> =
<NftsOf<T> as Inspect<<T as frame_system::Config>::AccountId>>::CollectionId;
type ItemIdOf<T> = <NftsOf<T> as Inspect<<T as frame_system::Config>::AccountId>>::ItemId;
type ItemPriceOf<T> = BalanceOf<T>;
type CollectionDetailsFor<T> = CollectionDetails<AccountIdOf<T>, BalanceOf<T>>;
type AttributeNamespaceOf<T> = AttributeNamespace<AccountIdOf<T>>;
type CollectionConfigFor<T> =
CollectionConfig<ItemPriceOf<T>, BlockNumberFor<T>, CollectionIdOf<T>>;
// Type aliases for pallet-nfts storage items.
pub(super) type AccountBalanceOf<T> = pallet_nfts::AccountBalance<T, NftsInstanceOf<T>>;
pub(super) type AttributeOf<T> = pallet_nfts::Attribute<T, NftsInstanceOf<T>>;
pub(super) type NextCollectionIdOf<T> = pallet_nfts::NextCollectionId<T, NftsInstanceOf<T>>;
pub(super) type CollectionOf<T> = pallet_nfts::Collection<T, NftsInstanceOf<T>>;

#[frame_support::pallet]

Check warning on line 25 in pallets/api/src/nonfungibles/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for an associated function

warning: missing documentation for an associated function --> pallets/api/src/nonfungibles/mod.rs:25:1 | 25 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this warning originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)
pub mod pallet {
use frame_support::{
dispatch::{DispatchResult, DispatchResultWithPostInfo, WithPostDispatchInfo},
Expand All @@ -50,8 +30,6 @@
traits::Incrementable,
};
use frame_system::pallet_prelude::*;
use pallet_nfts::{CancelAttributesApprovalWitness, DestroyWitness, MintWitness};
use sp_runtime::BoundedVec;
use sp_std::vec::Vec;

use super::*;
Expand Down Expand Up @@ -104,7 +82,7 @@
/// The namespace of the attribute.
namespace: AttributeNamespaceOf<T>,
/// The key of the attribute.
key: BoundedVec<u8, T::KeyLimit>,
key: AttributeKey<T>,
},
/// Details of a specified collection.
#[codec(index = 9)]
Expand Down Expand Up @@ -217,188 +195,188 @@
},
}

#[pallet::call]
impl<T: Config> Pallet<T> {
/// Transfers the collection item from the caller's account to account `to`.
///
/// # Parameters
/// - `collection` - The collection of the item to transfer.
/// - `item` - The item to transfer.
/// - `to` - The recipient account.
#[pallet::call_index(3)]
#[pallet::weight(NftsWeightInfoOf::<T>::transfer())]
pub fn transfer(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: ItemIdOf<T>,
to: AccountIdOf<T>,
) -> DispatchResult {
let from = ensure_signed(origin.clone())?;
NftsOf::<T>::transfer(origin, collection, item, T::Lookup::unlookup(to.clone()))?;
Self::deposit_event(Event::Transfer {
collection,
item,
from: Some(from),
to: Some(to),
price: None,
});
Ok(())
}

/// Approves `operator` to spend the collection item on behalf of the caller.
///
/// # Parameters
/// - `collection` - The collection of the item to approve for a delegated transfer.
/// - `item` - The item to approve for a delegated transfer.
/// - `operator` - The account that is allowed to spend the collection item.
/// - `approved` - The approval status of the collection item.
#[pallet::call_index(4)]
#[pallet::weight(
NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32) +
NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
)]
pub fn approve(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: Option<ItemIdOf<T>>,
operator: AccountIdOf<T>,
approved: bool,
) -> DispatchResultWithPostInfo {
let owner = ensure_signed(origin.clone())?;
let weight = if approved {
NftsOf::<T>::approve_transfer(
origin,
collection,
item,
T::Lookup::unlookup(operator.clone()),
None,
)
.map_err(|e| {
e.with_weight(NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32))
})?;
NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32)
} else {
NftsOf::<T>::cancel_approval(
origin,
collection,
item,
T::Lookup::unlookup(operator.clone()),
)
.map_err(|e| {
e.with_weight(NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32))
})?;
NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
};
Self::deposit_event(Event::Approval { collection, item, operator, owner, approved });
Ok(Some(weight).into())
}

/// Issue a new collection of non-fungible items from a public origin.
///
/// # Parameters
/// - `admin` - The admin of this collection. The admin is the initial address of each
/// member of the collection's admin team.
/// - `config` - The configuration of the collection.
#[pallet::call_index(7)]
#[pallet::weight(NftsWeightInfoOf::<T>::create())]
pub fn create(
origin: OriginFor<T>,
admin: AccountIdOf<T>,
config: CollectionConfigFor<T>,
) -> DispatchResult {
let creator = ensure_signed(origin.clone())?;
// TODO: re-evaluate next collection id in nfts pallet. The `Incrementable` trait causes
// issues for setting it to xcm's `Location`. This can easily be done differently.
let id = NextCollectionIdOf::<T>::get()
.or(T::CollectionId::initial_value())
.ok_or(NftsErrorOf::<T>::UnknownCollection)?;
NftsOf::<T>::create(origin, T::Lookup::unlookup(admin.clone()), config)?;
Self::deposit_event(Event::Created { id, creator, admin });
Ok(())
}

/// Destroy a collection of fungible items.
///
/// # Parameters
/// - `collection` - The collection to destroy.
/// - `witness` - Information on the items minted in the collection. This must be
/// correct.
#[pallet::call_index(8)]
#[pallet::weight(NftsWeightInfoOf::<T>::destroy(
witness.item_metadatas,
witness.item_configs,
witness.attributes,
witness.item_holders,
witness.allowances,
))]
pub fn destroy(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
witness: DestroyWitness,
) -> DispatchResultWithPostInfo {
NftsOf::<T>::destroy(origin, collection, witness)
}

/// Set an attribute for a collection or item.
///
/// # Parameters
/// - `collection` - The collection whose item's metadata to set.
/// - `maybe_item` - The item whose metadata to set.
/// - `namespace` - Attribute's namespace.
/// - `key` - The key of the attribute.
/// - `value` - The value to which to set the attribute.
#[pallet::call_index(12)]
#[pallet::weight(NftsWeightInfoOf::<T>::set_attribute())]
pub fn set_attribute(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: Option<ItemIdOf<T>>,
namespace: AttributeNamespaceOf<T>,
key: BoundedVec<u8, T::KeyLimit>,
value: BoundedVec<u8, T::ValueLimit>,
key: AttributeKey<T>,
value: AttributeValue<T>,
) -> DispatchResult {
NftsOf::<T>::set_attribute(origin, collection, item, namespace, key, value)
}

/// Clear an attribute for the collection or item.
///
/// # Parameters
/// - `collection` - The collection whose item's metadata to clear.
/// - `maybe_item` - The item whose metadata to clear.
/// - `namespace` - Attribute's namespace.
/// - `key` - The key of the attribute.
#[pallet::call_index(13)]
#[pallet::weight(NftsWeightInfoOf::<T>::clear_attribute())]
pub fn clear_attribute(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: Option<ItemIdOf<T>>,
namespace: AttributeNamespaceOf<T>,
key: BoundedVec<u8, T::KeyLimit>,
key: AttributeKey<T>,
) -> DispatchResult {
NftsOf::<T>::clear_attribute(origin, collection, item, namespace, key)
}

/// Set the metadata for an item.
///
/// # Parameters
/// - `collection` - The collection whose item's metadata to set.
/// - `item` - The item whose metadata to set.
/// - `data` - The general information of this item. Limited in length by `StringLimit`.
#[pallet::call_index(14)]
#[pallet::weight(NftsWeightInfoOf::<T>::set_metadata())]
pub fn set_metadata(
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: ItemIdOf<T>,
data: BoundedVec<u8, T::StringLimit>,
data: MetadataData<T>,
) -> DispatchResult {
NftsOf::<T>::set_metadata(origin, collection, item, data)
}

#[pallet::call_index(15)]
#[pallet::weight(NftsWeightInfoOf::<T>::clear_metadata())]
pub fn clear_metadata(

Check warning on line 379 in pallets/api/src/nonfungibles/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a variant

warning: missing documentation for a variant --> pallets/api/src/nonfungibles/mod.rs:198:12 | 198 | #[pallet::call] | _______________^ 199 | | impl<T: Config> Pallet<T> { 200 | | /// Transfers the collection item from the caller's account to account `to`. 201 | | /// ... | 378 | | #[pallet::weight(NftsWeightInfoOf::<T>::clear_metadata())] 379 | | pub fn clear_metadata( | |_____________________________^
origin: OriginFor<T>,
collection: CollectionIdOf<T>,
item: ItemIdOf<T>,
Expand Down
31 changes: 31 additions & 0 deletions pallets/api/src/nonfungibles/types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use super::*;

pub(super) type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
pub(super) type NftsOf<T> = pallet_nfts::Pallet<T, NftsInstanceOf<T>>;
pub(super) type NftsErrorOf<T> = pallet_nfts::Error<T, NftsInstanceOf<T>>;
pub(super) type NftsWeightInfoOf<T> = <T as pallet_nfts::Config<NftsInstanceOf<T>>>::WeightInfo;
pub(super) type NftsInstanceOf<T> = <T as Config>::NftsInstance;
pub(super) type BalanceOf<T> =
<<T as pallet_nfts::Config<NftsInstanceOf<T>>>::Currency as Currency<
<T as frame_system::Config>::AccountId,
>>::Balance;
pub(super) type CollectionIdOf<T> =
<NftsOf<T> as Inspect<<T as frame_system::Config>::AccountId>>::CollectionId;
pub(super) type ItemIdOf<T> =
<NftsOf<T> as Inspect<<T as frame_system::Config>::AccountId>>::ItemId;
pub(super) type ItemPriceOf<T> = BalanceOf<T>;
pub(super) type CollectionDetailsFor<T> = CollectionDetails<AccountIdOf<T>, BalanceOf<T>>;
pub(super) type AttributeNamespaceOf<T> = AttributeNamespace<AccountIdOf<T>>;
pub(super) type CollectionConfigFor<T> =
CollectionConfig<ItemPriceOf<T>, BlockNumberFor<T>, CollectionIdOf<T>>;
// Public due to pop-api integration tests crate.
pub type AccountBalanceOf<T> = pallet_nfts::AccountBalance<T, NftsInstanceOf<T>>;

Check warning on line 22 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:22:1 | 22 | pub type AccountBalanceOf<T> = pallet_nfts::AccountBalance<T, NftsInstanceOf<T>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub type AttributeOf<T> = pallet_nfts::Attribute<T, NftsInstanceOf<T>>;

Check warning on line 23 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:23:1 | 23 | pub type AttributeOf<T> = pallet_nfts::Attribute<T, NftsInstanceOf<T>>; | ^^^^^^^^^^^^^^^^^^^^^^^
pub type AttributeKey<T> = BoundedVec<u8, <T as pallet_nfts::Config<NftsInstanceOf<T>>>::KeyLimit>;

Check warning on line 24 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:24:1 | 24 | pub type AttributeKey<T> = BoundedVec<u8, <T as pallet_nfts::Config<NftsInstanceOf<T>>>::KeyLimit>; | ^^^^^^^^^^^^^^^^^^^^^^^^
pub type AttributeValue<T> =

Check warning on line 25 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:25:1 | 25 | pub type AttributeValue<T> = | ^^^^^^^^^^^^^^^^^^^^^^^^^^
BoundedVec<u8, <T as pallet_nfts::Config<NftsInstanceOf<T>>>::ValueLimit>;
pub type CollectionOf<T> = pallet_nfts::Collection<T, NftsInstanceOf<T>>;

Check warning on line 27 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:27:1 | 27 | pub type CollectionOf<T> = pallet_nfts::Collection<T, NftsInstanceOf<T>>; | ^^^^^^^^^^^^^^^^^^^^^^^^
pub type CollectionConfigOf<T> = pallet_nfts::CollectionConfigOf<T, NftsInstanceOf<T>>;

Check warning on line 28 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:28:1 | 28 | pub type CollectionConfigOf<T> = pallet_nfts::CollectionConfigOf<T, NftsInstanceOf<T>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub type NextCollectionIdOf<T> = pallet_nfts::NextCollectionId<T, NftsInstanceOf<T>>;

Check warning on line 29 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:29:1 | 29 | pub type NextCollectionIdOf<T> = pallet_nfts::NextCollectionId<T, NftsInstanceOf<T>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub type MetadataData<T> =

Check warning on line 30 in pallets/api/src/nonfungibles/types.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a type alias

warning: missing documentation for a type alias --> pallets/api/src/nonfungibles/types.rs:30:1 | 30 | pub type MetadataData<T> = | ^^^^^^^^^^^^^^^^^^^^^^^^
BoundedVec<u8, <T as pallet_nfts::Config<NftsInstanceOf<T>>>::StringLimit>;
3 changes: 3 additions & 0 deletions pop-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name = "pop-api"
version = "0.0.0"

[dependencies]
bitflags = { version = "1.3.2" }
enumflags2 = "0.7.9"
ink = { version = "5.0.0", default-features = false }
pop-primitives = { path = "../primitives", default-features = false }
sp-io = { version = "37.0.0", default-features = false, features = [
Expand All @@ -22,4 +24,5 @@ path = "src/lib.rs"
[features]
default = [ "std" ]
fungibles = [ ]
nonfungibles = [ ]
std = [ "ink/std", "pop-primitives/std", "sp-io/std" ]
5 changes: 5 additions & 0 deletions pop-api/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ frame-support = { version = "36.0.0", default-features = false }
frame-support-procedural = { version = "=30.0.1", default-features = false }
frame-system = { version = "36.1.0", default-features = false }
log = "0.4.22"
pallet-api = { path = "../../pallets/api", default-features = false }
pallet-assets = { version = "37.0.0", default-features = false }
pallet-balances = { version = "37.0.0", default-features = false }
pallet-contracts = { version = "35.0.0", default-features = false }
pallet-nfts = { path = "../../pallets/nfts", default-features = false }
pop-api = { path = "../../pop-api", default-features = false, features = [
"fungibles",
"nonfungibles",
] }
pop-primitives = { path = "../../primitives", default-features = false }
pop-runtime-devnet = { path = "../../runtime/devnet", default-features = false }
Expand All @@ -36,9 +39,11 @@ devnet = [ ]
std = [
"frame-support/std",
"frame-system/std",
"pallet-api/std",
"pallet-assets/std",
"pallet-balances/std",
"pallet-contracts/std",
"pallet-nfts/std",
"pop-api/std",
"pop-primitives/std",
"pop-runtime-devnet/std",
Expand Down
21 changes: 21 additions & 0 deletions pop-api/integration-tests/contracts/nonfungibles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
authors = [ "R0GUE <[email protected]>" ]
edition = "2021"
name = "nonfungibles"
version = "0.1.0"

[dependencies]
ink = { version = "5.0.0", default-features = false }
pop-api = { path = "../../../../pop-api", default-features = false, features = [ "nonfungibles" ] }

[lib]
path = "lib.rs"

[features]
default = [ "std" ]
e2e-tests = [ ]
ink-as-dependency = [ ]
std = [
"ink/std",
"pop-api/std",
]
Loading
Loading