diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e8851a59c4..df538bbf29 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -958,8 +958,8 @@ impl Pallet { >::put(destroyed_collections); >::remove(collection.id); >::remove(collection.id); - >::remove_prefix((collection.id,), None); - >::remove_prefix((collection.id,), None); + let _ = >::clear_prefix((collection.id,), u32::MAX, None); + let _ = >::clear_prefix((collection.id,), u32::MAX, None); >::remove(collection.id); >::deposit_event(Event::CollectionDestroyed(collection.id)); diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 458c2dd305..777e71d0d2 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -231,8 +231,8 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index ba87344324..23041d44cd 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -429,13 +429,13 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); >::remove(id); >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } @@ -487,7 +487,7 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token)); >::remove((collection.id, token)); - >::remove_prefix((collection.id, token), None); + let _ = >::clear_prefix((collection.id, token), u32::MAX, None); let old_spender = >::take((collection.id, token)); if let Some(old_spender) = old_spender { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 7ebe3dc9ae..9ba65a5d50 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -398,11 +398,11 @@ impl Pallet { >::remove(id); >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } @@ -424,6 +424,7 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); +<<<<<<< HEAD >::remove_prefix((collection.id, token_id), None); >::remove_prefix((collection.id, token_id), None); @@ -435,6 +436,11 @@ impl Pallet { } .to_log(collection_id_to_address(collection.id)), ); +======= + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); + // TODO: ERC721 transfer event +>>>>>>> 5d9665e0... refactor: switch to new prefix removal methods Ok(()) } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 93f6c47620..1ad2a12e1c 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -373,13 +373,16 @@ decl_module! { T::CollectionDispatch::destroy(sender, collection)?; - >::remove_prefix(collection_id, None); - >::remove_prefix(collection_id, None); - >::remove_prefix((collection_id,), None); + // TODO: basket cleanup should be moved elsewhere + // Maybe runtime dispatch.rs should perform it? - >::remove_prefix(collection_id, None); - >::remove_prefix(collection_id, None); - >::remove_prefix((collection_id,), None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); + + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); Ok(()) }