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

Update validation of GasPrice.fromString to allow using ibc denoms as gas denom #1522

Merged

Conversation

madrezaz
Copy link
Contributor

Currently the GasPrice.fromString method claims that the denom validation matches the "Cosmos SDK 0.42 pattern"; But the regex being used for validation is not the same as the one used in the sdk. Because of that, creating a gas price using IBC denoms which contain "/" is not possible and throws an error. This PR intends to update the validation regex to fix this issue.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Thank for the fix. Could you keep the structure of the code as it was before? This provides much more detailed error messages to the user in case something is wrong.

@madrezaz
Copy link
Contributor Author

@webmaster128 sure. although the reason I changed the structure was the consistency of the regex with the one in the sdk.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Thank you! Could you rebase that to latest main? I made a bis of an mistake before where the 0.32.1 release was published to npm but not yet pushed to GitHub. I.e. the new CHANGELOG entry should move into the Unreleased section above 0.32.1.

packages/stargate/src/fee.ts Outdated Show resolved Hide resolved
@madrezaz madrezaz force-pushed the fix-gas-price-validation-regex branch from db1cf5f to fb20b92 Compare December 19, 2023 10:58
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Thanks

@webmaster128
Copy link
Member

okay, just the linter: yarn && yarn lint-fix should do

@webmaster128 webmaster128 merged commit 62a4ad1 into cosmos:main Dec 19, 2023
13 checks passed
@webmaster128
Copy link
Member

released today as part of 0.32.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants