Skip to content
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

fix: get next asset id issue #11213

Merged
merged 5 commits into from
Jan 21, 2025
Merged

fix: get next asset id issue #11213

merged 5 commits into from
Jan 21, 2025

Conversation

ap211unitech
Copy link
Contributor

@ap211unitech ap211unitech commented Jan 19, 2025

📝 Description

When creating a new asset, the Asset ID field should default to the next possible asset_id which is basically last_created_asset_id + 1

Screenshot from 2024-10-04 12-46-08

🤔 Previous behavior

The current UI makes it seem that any asset id would work, but after a runtime upgrade it is required that newly created asset id's follow a specific rule: the newly created asset's id should be the next possible id of the last created asset.

In other terms, next_asset_id = previous_asset_id + 1

  • What is the motivation for changing the behavior?

Without this change, users will face this error:

Screenshot from 2024-10-04 12-48-33

🚀 Current behavior

image

✅ Tasks

  • Fix findOpenId method to calculate default asset id
  • For Asset Hub, Next asset id is prev asset id + 1

@ap211unitech ap211unitech self-assigned this Jan 19, 2025
@ap211unitech ap211unitech marked this pull request as ready for review January 21, 2025 08:27
@ap211unitech ap211unitech requested a review from TarikGul January 21, 2025 08:33
@ap211unitech ap211unitech linked an issue Jan 21, 2025 that may be closed by this pull request
7 tasks
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great, really good job!

@TarikGul TarikGul merged commit ee75d54 into master Jan 21, 2025
5 checks passed
@TarikGul TarikGul deleted the fix/nextAssetId branch January 21, 2025 15:47
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation for asset id when creating a new asset on AssetHub
3 participants