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

Adding hex flag to handle invalid hex field #4325

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

patnir
Copy link
Contributor

@patnir patnir commented Sep 29, 2023

Summary

Fixes: IFL-1714

https://linear.app/if-labs/issue/IFL-1714/cli-crashes-with-assetid-flag

Result (on Testnet)

Invalid hex value for asset id:
image

Valid hex value:
image

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@patnir patnir requested a review from a team as a code owner September 29, 2023 22:05
parse: async (input, _ctx, opts) => {
const hexRegex = /^[0-9A-Fa-f]+$/g
if (!hexRegex.test(input)) {
throw new Error(`The hex string is invalid for field ${opts.name}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about this error message a bit. I wonder if something like "The value provided for ${opts.name} is an invalid format. The value must only contain numbers and letters A-F" or something. I wouldn't want the expectation that a user should know or care what hex is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@patnir patnir merged commit 09a5704 into staging Oct 12, 2023
@patnir patnir deleted the rahul/ifl-1714-cli-crashes-with-assetid-flag branch October 12, 2023 18:10
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