-
Notifications
You must be signed in to change notification settings - Fork 32
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(contracts-rfq): increase coverage #3453
Conversation
WalkthroughThe changes in this pull request involve the addition of new external functions across several Solidity test contracts to prevent them from appearing in code coverage reports. Additionally, updates to comment directives for the Solidity linter have been made to disable warnings related to empty blocks. The logic and functionality of existing methods in these contracts remain unchanged. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
|
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 (3)
packages/contracts-rfq/test/mocks/VaultMock.sol (1)
6-6
: LGTM! Consider documenting the coverage exclusion pattern.The addition of the empty test function and solhint directive follows the project's pattern for coverage report management. Consider adding a comment in the test documentation explaining this pattern for better maintainability.
Consider adding this pattern to your testing documentation:
## Test Coverage Management Empty test functions are added to mock/harness contracts to prevent them from appearing in coverage reports while maintaining their testing utility.
Also applies to: 17-18
packages/contracts-rfq/test/integration/FastBridgeV2.MulticallTarget.t.sol (1)
9-12
: LGTM! Consider enhancing test coverage.While the empty test function follows the project's pattern, consider adding actual test cases in this contract to validate the bridge transaction encoding logic.
Would you like me to help generate comprehensive test cases for the bridge transaction encoding functionality?
packages/contracts-rfq/test/harnesses/ZapDataV1Harness.sol (1)
6-6
: LGTM! Consider improving harness documentation.The empty test function addition follows the project's pattern. The harness provides good coverage of ZapDataV1 library functionality.
Consider adding NatSpec documentation to describe the harness's purpose and relationship with the ZapDataV1 library:
/// @title ZapDataV1Harness /// @notice Test harness providing direct access to ZapDataV1 library functions /// @dev Used for testing ZapDataV1 encoding/decoding functionalityAlso applies to: 11-12
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (9)
packages/contracts-rfq/test/FastBridgeV2.Src.RefundV1.t.sol
(1 hunks)packages/contracts-rfq/test/harnesses/BridgeTransactionV2Harness.sol
(1 hunks)packages/contracts-rfq/test/harnesses/ZapDataV1Harness.sol
(1 hunks)packages/contracts-rfq/test/integration/FastBridge.MulticallTarget.t.sol
(1 hunks)packages/contracts-rfq/test/integration/FastBridgeV2.MulticallTarget.t.sol
(1 hunks)packages/contracts-rfq/test/integration/TokenZapV1.t.sol
(2 hunks)packages/contracts-rfq/test/mocks/MockRevertingRecipient.sol
(1 hunks)packages/contracts-rfq/test/mocks/VaultMock.sol
(2 hunks)packages/contracts-rfq/test/zaps/TokenZapV1.t.sol
(2 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/contracts-rfq/test/FastBridgeV2.Src.RefundV1.t.sol (2)
Learnt from: ChiTimesChi
PR: synapsecns/sanguine#3284
File: packages/contracts-rfq/contracts/FastBridgeV2.sol:100-118
Timestamp: 2024-11-12T03:37:08.148Z
Learning: When reviewing code in `packages/contracts-rfq/contracts/FastBridgeV2.sol` (Solidity), focus on changes introduced in the PR and avoid commenting on existing functions like `refund` if they are not modified by the PR, as such comments are considered out of scope.
Learnt from: ChiTimesChi
PR: synapsecns/sanguine#3284
File: packages/contracts-rfq/test/FastBridgeV2.t.sol:53-56
Timestamp: 2024-11-12T03:37:02.230Z
Learning: Modifying test utility contracts in the `test` directory is unnecessary and would only pollute the code.
🔇 Additional comments (8)
packages/contracts-rfq/test/mocks/MockRevertingRecipient.sol (1)
4-4
: LGTM! Changes align with coverage improvement goals.
The addition of the empty test function and its documentation clearly explains the purpose of preventing the contract from appearing in coverage reports. The naming convention follows the contract name pattern consistently.
Also applies to: 10-11
packages/contracts-rfq/test/FastBridgeV2.Src.RefundV1.t.sol (1)
6-6
: LGTM! Consistent with coverage improvement pattern.
The empty test function addition follows the established pattern for coverage reporting improvement. The expanded solhint directive appropriately handles test-specific linting rules.
Also applies to: 8-9
packages/contracts-rfq/test/integration/FastBridge.MulticallTarget.t.sol (1)
8-8
: LGTM! Maintains consistency with coverage improvements.
The empty test function addition and its documentation align with the established pattern across other test files. The solhint directive is appropriately scoped for test contracts.
Also applies to: 10-11
packages/contracts-rfq/test/harnesses/BridgeTransactionV2Harness.sol (1)
6-9
: LGTM: Empty test function added to exclude from coverage.
The empty test function with the descriptive comment is a good practice to prevent test harnesses from appearing in coverage reports.
packages/contracts-rfq/test/integration/TokenZapV1.t.sol (1)
14-14
: LGTM: Updated solhint directive.
The solhint directive has been updated to include no-empty-blocks, which is consistent with the changes across test files.
packages/contracts-rfq/test/zaps/TokenZapV1.t.sol (3)
420-428
: LGTM: Well-structured helper function for native token transfers.
The function follows the established pattern and correctly encodes the zap data with appropriate parameters.
430-460
: LGTM: Comprehensive test coverage for native token transfers.
The test functions thoroughly cover:
- Transfers to EOA and contract addresses
- Handling of extra funds
- Balance verification
589-593
: LGTM: Proper error handling test for native token transfers.
The test correctly verifies that transfers to non-payable contracts revert with the appropriate error.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3453 +/- ##
===================================================
+ Coverage 98.72408% 98.88357% +0.15949%
===================================================
Files 11 11
Lines 627 627
===================================================
+ Hits 619 620 +1
+ Misses 8 7 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Deploying sanguine-fe with Cloudflare Pages
|
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
TokenZapV1Test
contract.