Skip to content

Commit

Permalink
impl DecodeWithMemTracking for pallet-nfts structs
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Feb 18, 2025
1 parent f3da494 commit aad2b6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion substrate/frame/nfts/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use super::*;
use crate::macros::*;
use alloc::{vec, vec::Vec};
use codec::EncodeLike;
use codec::{DecodeWithMemTracking, EncodeLike};
use enumflags2::{bitflags, BitFlags};
use frame_support::{
pallet_prelude::{BoundedVec, MaxEncodedLen},
Expand Down Expand Up @@ -332,6 +332,9 @@ impl CollectionSettings {
}

impl_codec_bitflags!(CollectionSettings, u64, CollectionSetting);
// We can implement `DecodeWithMemTracking` for `CollectionSettings`
// since `u64` also implements `DecodeWithMemTracking`.
impl DecodeWithMemTracking for CollectionSettings {}

/// Mint type. Can the NFT be create by anyone, or only the creator of the collection,
/// or only by wallets that already hold an NFT from a certain collection?
Expand Down Expand Up @@ -514,6 +517,9 @@ impl ItemSettings {
}

impl_codec_bitflags!(ItemSettings, u64, ItemSetting);
// We can implement `DecodeWithMemTracking` for `ItemSettings`
// since `u64` also implements `DecodeWithMemTracking`.
impl DecodeWithMemTracking for ItemSettings {}

/// Item's configuration.
#[derive(
Expand Down

0 comments on commit aad2b6a

Please sign in to comment.