Closed mattverse closed 3 months ago
The update primarily focuses on enhancing the handling and validation of coin denominations within the system. It introduces a specialized function for character validation, revamps the regular expression handling, and implements a new function for checking the validity of denomination strings. Additionally, the test suite has been expanded to include custom validation and specific denomination validation, ensuring a robust and error-free denomination handling mechanism.
File(s) | Change Summary |
---|---|
types/coin.go |
- Refactored regex handling for denominations - Added isValidRune and MatchDenom functions- Updated and added new tests for denomination validation |
types/dec_coin.go |
- Added unicode package import- Modified ParseDecCoin for custom parsing logic- Introduced ParseDecAmount for parsing coin strings |
🐇✨
In a burrow, deep and wide,
A rabbit worked with code-filled pride.
With each key tap, and each line neat,
Made coin denominations validate so sweet.
"Hoppity hop," it said with glee,
"For cleaner, safer code, follow me!"
🌟🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Setting as draft until tests are fixed
linting is failing but tbh idk why + im not sure if we want to create divergance with upstream just for this lint 🤔 @czarcas7ic thoughts?
I agree, idc about linting
I mean, can we add an ignore line so every future PR doesnt fail
Its just saying to use switch instead of if else, should be able to add a gocritic ignore
@czarcas7ic ok, I actually can't fix the lint (nolint
is not working for some reason, also cannot replicate this lint error in my local env), I would rather fix our lint CI to something upstream sdk has, thoughts?
Yeah I am fine with any solution that keeps a lint CI check and passed
Description
Closes: #XXXX
Backports removal of regex usage on denom validation upstream
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking changeSummary by CodeRabbit