-
Notifications
You must be signed in to change notification settings - Fork 193
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
test(perp-keeper): add more tests for msg server for DnR #1686
Conversation
Warning Rate Limit Exceeded@Unique-Divine has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 5 minutes and 25 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe updates to the Changes
Related issues (Beta)
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- x/perp/v2/keeper/msg_server.go (2 hunks)
- x/perp/v2/keeper/msg_server_test.go (5 hunks)
Additional comments: 8
x/perp/v2/keeper/msg_server.go (3)
161-168: The nil check for
msg
inAllocateEpochRebates
method is correctly implemented to prevent nil pointer dereferences.178-185: The nil check for
msg
inWithdrawEpochRebates
method is correctly implemented to prevent nil pointer dereferences.159-168: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [159-185]
No further issues found in the provided hunks. The changes align with the summary and improve the robustness of the code by handling potential nil pointer dereferences.
x/perp/v2/keeper/msg_server_test.go (5)
7-10: The addition of the
inflationtypes
import is correctly reflected in the hunk and is consistent with the summary.148-148: The test case at line 148 is named "msg server close", which is consistent with the summary stating that a test case was renamed to this. However, the previous name "partial close" is not visible in the hunk, so we cannot confirm the renaming action.
172-195: The new test case for "partial close" starts at line 172 and is correctly implemented, but the line numbers do not match the summary, which states lines 167-176. The actual test case extends to line 195.
366-367: The summary mentions the addition of error handling for a nil message at line 344 in the
TestFailMsgServer
function, but this is not visible in the provided hunks. The closest related code is at lines 376-377, which checks for a nil message in a different function.444-496: The new function
TestAllocateEpochRebates
is correctly implemented starting at line 444, but the line numbers do not match the summary, which states line 412. The function includes tests for various scenarios, including nil message, insufficient funds, successful rebate allocation, and withdrawal of rebates for specific epochs.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- CHANGELOG.md (1 hunks)
Additional comments: 1
CHANGELOG.md (1)
- 74-75: The changelog correctly reflects the addition of new tests for the perp module msg server for DnR as described in the summary.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1686 +/- ##
==========================================
+ Coverage 73.92% 74.19% +0.27%
==========================================
Files 192 193 +1
Lines 15398 15445 +47
==========================================
+ Hits 11383 11460 +77
+ Misses 3355 3324 -31
- Partials 660 661 +1
|
Description
What does this PR do?
Purpose
Closes #1681
Summary by CodeRabbit
Bug Fixes
Tests
Documentation