-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Rename storage methods to follow the commonly accepted NFTs terminology. #13325
Conversation
This PR renames classes and instances to collections and items in the Uniques pallet in order to follow the commonly accepted NFTs terminology. PR paritytech#11389 renamed the extrinsics but storage helpers kept old names
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.
Not sure we should do this.
@@ -162,7 +162,7 @@ pub mod pallet { | |||
} | |||
|
|||
#[pallet::storage] | |||
#[pallet::storage_prefix = "Class"] | |||
#[pallet::storage_prefix = "Collection"] |
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.
We only set the storage_prefix
to have the better name Collection
inside the rust implementation without requiring a migration. Your proposed changes here require a migration.
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 created this PR because the current naming is not consistent. In one interface (extrinsics) it was refereed to as Collections and items and in the rpc interface there were suddenly called Classes and instances. I only discovered this when I saw the mismatch in documentation of #13322
I think the changes made in #11389 should have renamed these interfaces as well.
Pros: It gives a better experience for the users (developers) where it is easy to understand the connection
Cons: It is a change and it will break things.
Anyhow @bkchr I think you have a better view about the impact and implications here so I will trust your judgement if you don't want to do this, just pointing out the inconsistency which made me confused. Please handle it as you see fit.
Your proposed changes here require a migration.
@bkchr, So this is not only the name of the getter function, does this macro also declare the storage name?
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.
does this macro also declare the storage name?
Yes. storage_prefix
in this case is the storage name.
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.
@bkchr Is it possible to have meaningful names in the external API which out chaining the internal storage
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.
Currently not.
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR renames classes and instances to collections and items in the Uniques pallet in order to follow the commonly accepted NFTs terminology.
PR #11389 renamed the extrinsics but storage helpers kept old names