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

fixes yup currency validation with min #3688

Merged
merged 2 commits into from
Mar 23, 2023
Merged

fixes yup currency validation with min #3688

merged 2 commits into from
Mar 23, 2023

Conversation

hughy
Copy link
Contributor

@hughy hughy commented Mar 23, 2023

Summary

when using our custom 'currency' yup schema with a minimum value we do not catch errors from 'CurrencyUtils.decode'. this results in a non-yup error during validation if the value cannot be decoded.

an error other than 'yup.ValidationError' in an RPC endpoint crashes the node.

see #3662

Testing Plan

  • updates unit test. updated unit test fails before applying changes
  • manual testing
    • apply the attached diff to pass an invalid feeRate to the 'createTransaction' RPC
    • use the 'send' command, pass the invalid feeRate, and crash the node

test.diff.txt

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

when using our custom 'currency' yup schema with a minimum value we do not catch
errors from 'CurrencyUtils.decode'. this results in a non-yup error during
validation if the value cannot be decoded.

an error other than 'yup.ValidationError' in an RPC endpoint crashes the node.

see #3662
@hughy hughy requested a review from a team as a code owner March 23, 2023 22:29
updates tests expecting validation error message
@hughy hughy merged commit 4d33cf5 into staging Mar 23, 2023
@hughy hughy deleted the fix/yup-currency branch March 23, 2023 23:31
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