-
Notifications
You must be signed in to change notification settings - Fork 548
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
refactor: transfer relay tests #6321
Conversation
WalkthroughWalkthroughThe recent changes in Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Tester
participant TestSendTransfer
participant TestOnRecvPacket_ReceiverIsNotSource
participant TestOnRecvPacket_ReceiverIsSource
participant TestOnAcknowledgementPacket
participant TestOnTimeoutPacket
Tester->>TestSendTransfer: Execute tests with error handling
Tester->>TestOnRecvPacket_ReceiverIsNotSource: Execute tests for non-source receiver
Tester->>TestOnRecvPacket_ReceiverIsSource: Execute tests for source receiver
Tester->>TestOnAcknowledgementPacket: Execute tests with error handling
Tester->>TestOnTimeoutPacket: Execute tests for timeout packet handling
Assessment against linked issues
Warning Review ran into problemsProblems (1)
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.
Actionable comments posted: 0
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- modules/apps/transfer/keeper/relay_test.go (18 hunks)
Additional Context Used
GitHub Check Runs (1)
lint failure (3)
modules/apps/transfer/keeper/relay_test.go: [failure] 382-382:
transfered
is a misspelling oftransferred
(misspell)
Path-based Instructions (1)
modules/apps/transfer/keeper/relay_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 (9)
modules/apps/transfer/keeper/relay_test.go (9)
22-23
: The changes toTestSendTransfer
improve readability and maintainability. The use ofexpError
instead ofexpPass
is a good enhancement.
Line range hint
181-261
: The new test functionTestSendTransferSetsTotalEscrowAmountForSourceIBCToken
is well-structured and effectively tests the total escrow amount calculation.
262-266
: The changes toTestOnRecvPacket_ReceiverIsNotSource
improve readability and maintainability. The use ofexpError
instead ofexpPass
is a good enhancement.
381-385
: The new test functionTestOnRecvPacket_ReceiverIsSource
is well-structured and effectively tests receiving coins originating from chainB.
Line range hint
512-608
: The new test functionTestOnRecvPacketSetsTotalEscrowAmountForSourceIBCToken
is well-structured and effectively tests the total escrow amount calculation.
Line range hint
614-618
: The changes toTestOnAcknowledgementPacket
improve readability and maintainability. The use ofexpError
instead ofexpPass
is a good enhancement.
Line range hint
723-808
: The new test functionTestOnAcknowledgementPacketSetsTotalEscrowAmountForSourceIBCToken
is well-structured and effectively tests the total escrow amount calculation.
Line range hint
809-813
: The changes toTestOnTimeoutPacket
improve readability and maintainability. The use ofexpError
instead ofexpPass
is a good enhancement.
Line range hint
923-1008
: The new test functionTestOnTimeoutPacketSetsTotalEscrowAmountForSourceIBCToken
is well-structured and effectively tests the total escrow amount calculation.
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)
- modules/apps/transfer/keeper/relay_test.go (18 hunks)
Additional Context Used
Path-based Instructions (1)
modules/apps/transfer/keeper/relay_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 (19)
modules/apps/transfer/keeper/relay_test.go (19)
Line range hint
22-36
: Setup part looks good.
37-123
: Test cases are well-defined and cover various scenarios. The use ofexpError
improves readability.
Line range hint
158-177
: Assertions are correctly verifying the results of the test cases.
Line range hint
262-352
: Setup part looks good.
354-364
: Execution part looks good.
366-372
: Assertions are correctly verifying the total escrow amount after the transfer.
Line range hint
266-352
: Setup part looks good.
Line range hint
275-314
: Test cases are well-defined and cover various scenarios.
362-375
: Assertions are correctly verifying the results of the test cases.
385-474
: Setup part looks good.
395-450
: Test cases are well-defined and cover various scenarios.
496-512
: Assertions are correctly verifying the results of the test cases.
Line range hint
514-603
: Setup part looks good.
Line range hint
614-688
: Setup part looks good.
Line range hint
629-676
: Test cases are well-defined and cover various scenarios.
696-717
: Assertions are correctly verifying the results of the test cases.
Line range hint
809-896
: Setup part looks good.
Line range hint
825-884
: Test cases are well-defined and cover various scenarios.
905-922
: Assertions are correctly verifying the results of the test cases.
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)
- modules/apps/transfer/keeper/relay_test.go (19 hunks)
Additional Context Used
Path-based Instructions (1)
modules/apps/transfer/keeper/relay_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 (9)
modules/apps/transfer/keeper/relay_test.go (9)
4-11
: Ensure the newly added imports are utilized effectively in the test cases.
Line range hint
22-123
: Refactor ofTestSendTransfer
enhances clarity and coverage by explicitly testing various success and failure scenarios.
Line range hint
171-262
: The functionTestSendTransferSetsTotalEscrowAmountForSourceIBCToken
correctly sets up, executes, and asserts the escrow amounts for IBC tokens, ensuring the logic is isolated and testable.
Line range hint
262-378
: The refactoring ofTestOnRecvPacket_ReceiverIsNotSource
into more granular test cases improves the maintainability and clarity, aligning with the PR objectives.
380-511
: The functionTestOnRecvPacket_ReceiverIsSource
is well-structured to test various scenarios, ensuring comprehensive coverage and robustness of the feature.
Line range hint
613-808
: The functionTestOnRecvPacketSetsTotalEscrowAmountForSourceIBCToken
is structured effectively to test the escrow amount updates, ensuring the logic is isolated and testable.
Line range hint
808-921
: The functionTestOnTimeoutPacket
is well-structured to test various scenarios, ensuring comprehensive coverage and robustness of the timeout functionality.
Line range hint
921-1000
: The functionTestOnTimeoutPacketSetsTotalEscrowAmountForSourceIBCToken
is structured effectively to test the escrow amount updates, ensuring the logic is isolated and testable.
Line range hint
1000-1100
: The functionTestPacketForwardsCompatibility
effectively tests the module's ability to handle packets with unexpected new fields, ensuring robustness against future changes.
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.
checked cov locally, exactly the same here as in main. lgtm!
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.
LGTM! Thanks for cleaning up these tests, looking a lot nicer when separated.
# Conflicts: # modules/apps/transfer/keeper/relay_test.go
Quality Gate passed for 'ibc-go'Issues Measures |
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)
- modules/apps/transfer/keeper/relay_test.go (21 hunks)
Files skipped from review as they are similar to previous changes (1)
- modules/apps/transfer/keeper/relay_test.go
Description
TestOnRecvPacket
in two different tests (for receiver source and not source).expError
instead ofexpPass
.closes: #4598
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.Summary by CodeRabbit
Bug Fixes
Tests