Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.

8 changes: 4 additions & 4 deletions pop-api/Cargo.lock

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

6 changes: 3 additions & 3 deletions pop-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name = "pop-api"
version = "0.0.0"

[dependencies]
bitflags = { version = "1.3.2" }
enumflags2 = "0.7.9"
bitflags = { version = "2.8.0", optional = true }
enumflags2 = { version = "0.7.9", optional = true }

# Pop.
pop-primitives = { path = "../primitives", default-features = false }
Expand Down Expand Up @@ -35,7 +35,7 @@ path = "src/lib.rs"
default = [ "std" ]
fungibles = [ ]
messaging = [ ]
nonfungibles = [ ]
nonfungibles = [ "dep:bitflags", "dep:enumflags2" ]
std = [
"ink/std",
"pop-primitives/std",
Expand Down

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

22 changes: 0 additions & 22 deletions pop-api/integration-tests/contracts/fungibles/Cargo.lock

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

22 changes: 0 additions & 22 deletions pop-api/integration-tests/contracts/messaging/Cargo.lock

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

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

10 changes: 5 additions & 5 deletions pop-api/integration-tests/src/nonfungibles/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub(super) mod nfts {
) -> pallet_nfts::CollectionConfig<u128, BlockNumber, CollectionId> {
pallet_nfts::CollectionConfig {
settings: pallet_nfts::CollectionSettings::all_enabled(),
max_supply: None,
max_supply: Some(u32::MAX),
mint_settings: pallet_nfts::MintSettings::default(),
}
}
Expand Down Expand Up @@ -312,7 +312,7 @@ pub(super) mod nfts {
collection,
item,
operator.clone().into(),
None
Some(u32::MAX)
));
(collection, item)
}
Expand Down Expand Up @@ -352,9 +352,9 @@ pub(super) mod nfts {
pub(crate) fn default_mint_settings() -> MintSettings {
MintSettings {
mint_type: MintType::Issuer,
price: None,
start_block: None,
end_block: None,
price: Some(u128::MAX),
start_block: Some(u32::MIN),
end_block: Some(u32::MAX),
default_item_settings: ItemSettings::all_enabled(),
}
}
Expand Down
54 changes: 34 additions & 20 deletions pop-api/src/v0/nonfungibles/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
use enumflags2::{bitflags, BitFlags};

use super::*;
use crate::{macros::impl_codec_bitflags, primitives::AccountId};
use crate::{
macros::impl_codec_bitflags,
primitives::{AccountId, Balance},
};

type Balance = u32;
/// The identifier of a collection.
pub type CollectionId = u32;
/// The identifier of an item.
Expand Down Expand Up @@ -178,18 +180,30 @@ mod tests {
#[test]
fn ensure_destroy_witness() {
assert_eq!(
DestroyWitness { item_metadatas: 0, item_configs: 0, attributes: 0 }.encode(),
pallet_nfts::DestroyWitness { item_metadatas: 0, item_configs: 0, attributes: 0 }
.encode()
DestroyWitness {
item_metadatas: u32::MAX,
item_configs: u32::MAX,
attributes: u32::MAX
}
.encode(),
pallet_nfts::DestroyWitness {
item_metadatas: u32::MAX,
item_configs: u32::MAX,
attributes: u32::MAX
}
.encode()
);
}

#[test]
fn ensure_mint_witness() {
assert_eq!(
MintWitness { owned_item: None, mint_price: None }.encode(),
pallet_nfts::MintWitness::<ItemId, Balance> { owned_item: None, mint_price: None }
.encode()
MintWitness { owned_item: Some(u32::MAX), mint_price: Some(u128::MAX) }.encode(),
pallet_nfts::MintWitness::<ItemId, Balance> {
owned_item: Some(u32::MAX),
mint_price: Some(u128::MAX)
}
.encode()
);
}

Expand Down Expand Up @@ -228,13 +242,13 @@ mod tests {
assert_eq!(
CollectionConfig {
settings: CollectionSettings::all_enabled(),
max_supply: None,
max_supply: Some(u32::MAX),
mint_settings: default_mint_settings(),
}
.encode(),
pallet_nfts::CollectionConfig {
settings: pallet_nfts::CollectionSettings::all_enabled(),
max_supply: None,
max_supply: Some(u32::MAX),
mint_settings: default_pallet_mint_settings(),
}
.encode()
Expand All @@ -244,11 +258,11 @@ mod tests {
#[test]
fn ensure_mint_type() {
assert_eq!(
vec![MintType::Issuer, MintType::Public, MintType::HolderOf(0),].encode(),
vec![MintType::Issuer, MintType::Public, MintType::HolderOf(u32::MAX)].encode(),
vec![
pallet_nfts::MintType::Issuer,
pallet_nfts::MintType::Public,
pallet_nfts::MintType::HolderOf(0)
pallet_nfts::MintType::HolderOf(u32::MAX)
]
.encode()
);
Expand Down Expand Up @@ -281,8 +295,8 @@ mod tests {
#[test]
fn ensure_cancel_attributes_approval_witness() {
assert_eq!(
CancelAttributesApprovalWitness { account_attributes: 0 }.encode(),
pallet_nfts::CancelAttributesApprovalWitness { account_attributes: 0 }.encode(),
CancelAttributesApprovalWitness { account_attributes: u32::MAX }.encode(),
pallet_nfts::CancelAttributesApprovalWitness { account_attributes: u32::MAX }.encode(),
);
}

Expand Down Expand Up @@ -315,9 +329,9 @@ mod tests {
fn default_mint_settings() -> MintSettings {
MintSettings {
mint_type: MintType::Public,
price: None,
start_block: None,
end_block: None,
price: Some(u128::MAX),
start_block: Some(u32::MIN),
end_block: Some(u32::MAX),
default_item_settings: ItemSettings::all_enabled(),
}
}
Expand All @@ -326,9 +340,9 @@ mod tests {
) -> pallet_nfts::MintSettings<Balance, BlockNumber, CollectionId> {
pallet_nfts::MintSettings::<Balance, BlockNumber, CollectionId> {
mint_type: pallet_nfts::MintType::Public,
price: None,
start_block: None,
end_block: None,
price: Some(u128::MAX),
start_block: Some(u32::MIN),
end_block: Some(u32::MAX),
default_item_settings: pallet_nfts::ItemSettings::all_enabled(),
}
}
Expand Down
Loading