-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pallet assets: optional auto-increment for the asset ID #4757
Conversation
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
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.
The implementation is a little bit complicated ;) I mean it doesn't break anything or at least not that much.
Left some things to improve. A followup would be nice that improves the docs on how to use this.
/// [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration. For the auto- | ||
/// incremented model, the [`crate::AutoIncAssetId`] callback can be used. | ||
#[pallet::storage] | ||
pub type NextAssetId<T: Config<I>, I: 'static = ()> = StorageValue<_, T::AssetId, OptionQuery>; |
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.
There is no way to set this at genesis. Can you please add it to the GenesisConfig
?
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 did not touch it to make this non breaking change for most of the users. But no strong opinion.
You can see it now in GenesisConfig
.
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, but we need this here or otherwise test networks will have problems.
Co-authored-by: Bastian Köcher <git@kchr.de>
I updated docs, added the new storage item to the genesis config. |
The CI pipeline was cancelled due to failure one of the required jobs. |
I think we can go ahead. |
Introduce an optional auto-increment setup for the IDs of new assets.