-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: remove recipient amount from map #20625
Conversation
WalkthroughThe recent updates to the Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Good work.
I don't have the full context on this module but the changes do the opposite steps to the create function
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: 0
Outside diff range and nitpick comments (1)
x/protocolpool/keeper/msg_server_test.go (1)
Line range hint
813-963
: The addition ofrecipient3
in theTestCancelContinuousFund
function is well-implemented and covers the necessary scenarios to ensure theCancelContinuousFund
method behaves as expected with multiple recipients.Consider adding more edge cases, such as simultaneous cancellation requests or rapid sequence operations, to ensure robustness under stress or race conditions.
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- x/protocolpool/keeper/msg_server.go (1 hunks)
- x/protocolpool/keeper/msg_server_test.go (3 hunks)
Additional context used
Path-based instructions (2)
x/protocolpool/keeper/msg_server.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/protocolpool/keeper/msg_server_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
Additional comments not posted (1)
x/protocolpool/keeper/msg_server.go (1)
204-210
: The changes to remove recipient fund percentage and distribution upon fund cancellation are correctly implemented.Ensure that the removal of these items does not affect other parts of the system that might rely on this data being present until a certain point in the transaction lifecycle.
#!/bin/bash # Description: Verify that no other parts of the system are affected by the early removal of fund data. # Test: Search for any other references to `RecipientFundPercentage` and `RecipientFundDistribution` that might expect these to exist post-cancellation. rg --type go $'RecipientFundPercentage|RecipientFundDistribution'
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: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/protocolpool/keeper/msg_server.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/protocolpool/keeper/msg_server.go
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: 0
Outside diff range and nitpick comments (1)
x/protocolpool/keeper/keeper.go (1)
Line range hint
261-306
: TheiterateAndUpdateFundsDistribution
function has been refactored to use the newrecipientFund
struct. Ensure that the total percentage calculation is correctly implemented as it seems to be missing in the current logic.- totalPercentageToBeDistributed := math.ZeroInt() + totalPercentageToBeDistributed := math.ZeroInt() + for _, fund := range recipientFundList { + totalPercentageToBeDistributed = totalPercentageToBeDistributed.Add(fund.Percentage) + }
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/protocolpool/keeper/keeper.go (2 hunks)
Additional context used
Path-based instructions (1)
x/protocolpool/keeper/keeper.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (1)
x/protocolpool/keeper/keeper.go (1)
257-260
: IntroducedrecipientFund
struct to manage recipient addresses and their corresponding percentages.
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: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/protocolpool/keeper/keeper.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/protocolpool/keeper/keeper.go
* main: fix(x/staking): stop validators from rotating to the same key on the same block (#20649) perf: add cache to address codec (#20122) build(deps): Bump google.golang.org/protobuf from 1.34.1 to 1.34.2 (#20632) fix: remove recipient amount from map (#20625) fix(proto): remove conditional preventing proper generated file placement (#20650) (serverv2/cometbft) Read config from commands & handle `FlagNode` (#20621) fix(x/consensus): fix .proto file placement (#20646) fix(store): avoid nil error on not exhausted payload stream (#20644) fix (x/accounts): Fix genesis condition check (#20645) feat(accounts): add genesis account initialization (#20642) fix(x/gov): limit execution in gov (#20348)
Description
when canceling a fund the percentage was not removed from the map
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...
!
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
Bug Fixes
Refactor
Tests