This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Remove a max supply record on collection's destruction #11593
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
93ae03e
Remove a max supply record on collection's destruction
jsidorenko b0a8032
cargo run --quiet --profile=production --features=runtime-benchmarks…
40156d9
cargo run --quiet --profile=production --features=runtime-benchmarks…
9dc6310
cargo run --quiet --profile=production --features=runtime-benchmarks…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> { | |
Attribute::<T, I>::remove_prefix((&collection,), None); | ||
CollectionAccount::<T, I>::remove(&collection_details.owner, &collection); | ||
T::Currency::unreserve(&collection_details.owner, collection_details.total_deposit); | ||
CollectionMaxSupply::<T, I>::remove(&collection); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for not having the max supply be part or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's to avoid the unnecessary migrations, especially when we're going full speed ahead with Uniques V2 |
||
|
||
Self::deposit_event(Event::Destroyed { collection }); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to have the collections ID not be user controlled, but have it be an ever increasing integer.
That way the ID of a unique collection is itself unique.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also considered this in the context of fungible assets, because there can be issues when they are used on other chains. For example, if some asset is in the reserve account of parachain A, the owner nukes it, that asset's reserve-backed mint is in use on parachain A, and someone creates a new asset in the same ID, the users on para A wouldn't necessarily know about it.
We could also go the route of anonymous proxy like ID where we hash some module prefix with the block number / extrinsic index and get a 32 byte identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I completely agree with you. In V2 I've made the ids auto-generated, so you won't be able to get the same ID twice.
At the same time, the main idea behind the current IDs model is that you can batch your call and execute different actions on your collection since you know its ID.