-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(client/v2): *big.Int unmarshal #21853
Conversation
📝 Walkthrough📝 Walkthrough📝 WalkthroughWalkthroughThe pull request updates the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
This comment has been minimized.
This comment has been minimized.
doing a fix for the marshalling as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
client/v2/autocli/query.go (1)
239-241
: Improve comment formatting for better readabilityThe comment is split mid-sentence across multiple lines, which may hinder readability. Consider reformatting it for clarity.
Apply this diff to adjust the comment:
- // If the decimal doesn't contain a point, we assume it's a value formatted using the legacy - // `math.Dec`. So we try to parse it as an integer and then convert it to a - // decimal. + // If the decimal doesn't contain a point, we assume it's a value formatted using the legacy `math.Dec`. + // So we try to parse it as an integer and then convert it to a decimal.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📒 Files selected for processing (3)
- client/v2/CHANGELOG.md (1 hunks)
- client/v2/autocli/flag/legacy_dec.go (1 hunks)
- client/v2/autocli/query.go (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- client/v2/CHANGELOG.md
- client/v2/autocli/flag/legacy_dec.go
🧰 Additional context used
📓 Path-based instructions (1)
client/v2/autocli/query.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
🔇 Additional comments (2)
client/v2/autocli/query.go (2)
8-8
: Import "math/big" is necessary for big integer operationsThe addition of
"math/big"
is appropriate as it is required for handling big integers in the custom scalar encoding for"cosmos.Dec"
.
235-259
: Custom scalar encoding for "cosmos.Dec" is well-implementedThe custom scalar encoding correctly handles the conversion of legacy-formatted decimals and includes proper error handling for invalid inputs. The implementation aligns with best practices and conforms to the Uber Go style guide.
Reverted the fix for marshalling at e6e4583, as it was indeed not autocli related. |
(cherry picked from commit 43c41be) # Conflicts: # client/v2/CHANGELOG.md # x/tx/decode/decode.go
Co-authored-by: Julien Robert <[email protected]>
Description
Closes: #20935
I am mostly curious about what has changed between 0.50 to 0.52/main x/tx, which makes us need those extra encoders. For instance marshalling was working fine on 0.50, but regressed in 0.52.Fixed by #22161Author 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...
!
in 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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
*big.Int
in transactions.Documentation