From 6c4c550942e6b92f843b7aa16f03c92a89ed6e9c Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 06 Oct 2021 10:49:50 +0000 Subject: [PATCH] feat: handle amounts in burn_item --- --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -1611,11 +1611,13 @@ } match collection.mode { - CollectionMode::NFT => Self::burn_nft_item(collection, item_id)?, - CollectionMode::Fungible(_) => Self::burn_fungible_item(collection, item_owner, value)?, - CollectionMode::ReFungible => { - Self::burn_refungible_item(collection, item_id, item_owner)? - } + CollectionMode::NFT => match value { + 1 => Self::burn_nft_item(collection, item_id)?, + 0 => (), + _ => fail!(>::TokenValueTooLow), + }, + CollectionMode::Fungible(_) => Self::burn_fungible_item(collection, owner, value)?, + CollectionMode::ReFungible => Self::burn_refungible_item(collection, item_id, owner, value)?, _ => (), }; -- gitstuff