From f837334117a39ad58064ad78bb87763cf652c34e Mon Sep 17 00:00:00 2001 From: kozyrevdev <73348153+kozyrevdev@users.noreply.github.com> Date: Thu, 07 Oct 2021 14:58:29 +0000 Subject: [PATCH] Merge pull request #212 from UniqueNetwork/feature/skip-zero-transfers Skip zero value transfers in transferFrom --- --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -1354,6 +1354,10 @@ Self::check_white_list(&target_collection, &recipient)?; } + if value == 0 { + return Ok(()) + } + // Reduce approval by transferred amount or remove if remaining approval drops to 0 if approval.saturating_sub(value) > 0 { >::insert(collection_id, (item_id, &from, &sender), approval - value); @@ -2882,4 +2886,4 @@ } } -// #endregion \ No newline at end of file +// #endregion --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -151,7 +151,7 @@ spec_name: create_runtime_str!("nft"), impl_name: create_runtime_str!("nft"), authoring_version: 1, - spec_version: 3, + spec_version: 4, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, -- gitstuff