[NFTs] Fix consumers issue (#2653)

When we call the `set_accept_ownership` method, we increase the number
of account consumers, but then we don't decrease it on collection
transfer, which leads to the wrong consumers number an account has.
This commit is contained in:
Jegor Sidorenko
2023-12-19 15:23:58 +02:00
committed by GitHub
parent 0b74812ce8
commit 166ae5ae12
5 changed files with 33 additions and 21 deletions
+3 -3
View File
@@ -1153,11 +1153,11 @@ pub mod pallet {
pub fn transfer_ownership(
origin: OriginFor<T>,
collection: T::CollectionId,
owner: AccountIdLookupOf<T>,
new_owner: AccountIdLookupOf<T>,
) -> DispatchResult {
let origin = ensure_signed(origin)?;
let owner = T::Lookup::lookup(owner)?;
Self::do_transfer_ownership(origin, collection, owner)
let new_owner = T::Lookup::lookup(new_owner)?;
Self::do_transfer_ownership(origin, collection, new_owner)
}
/// Change the Issuer, Admin and Freezer of a collection.