-
Notifications
You must be signed in to change notification settings - Fork 14
Add Diamond contract unit tests #224
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
Add Diamond contract unit tests #224
Conversation
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.
Pull Request Overview
This PR adds unit tests for the Diamond contract as part of the migration to the Diamond pattern (ERC-2535). The tests verify Diamond contract deployment behavior, ownership setting, and facet cut functionality.
- Adds comprehensive unit tests for Diamond contract deployment scenarios
- Updates license headers to use SPDX-FileCopyrightText format
- Removes legacy Migrations.sol contract that's no longer needed
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/byContract/Diamond.test.ts | New test file covering Diamond deployment, ownership, and facet cut functionality |
contracts/tools/Migrations.sol | Removed legacy migrations contract |
contracts/Diamond.sol | Updated license header and comment formatting |
CHANGELOG.md | Added entry documenting the new Diamond unit tests |
Comments suppressed due to low confidence (2)
test/byContract/Diamond.test.ts:66
- The fallback redirection functionality mentioned in the PR description is not tested. Consider implementing this test to ensure the Diamond proxy correctly redirects fallback calls to facets.
it.skip('[TODO] Should redirect fallback', async () => {});
test/byContract/Diamond.test.ts:67
- The receive redirection functionality mentioned in the PR description is not tested. Consider implementing this test to ensure the Diamond proxy correctly redirects receive calls to facets.
it.skip('[TODO] Should redirect receive', async () => {});
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/diamond #224 +/- ##
===================================================
+ Coverage 84.35% 84.44% +0.08%
===================================================
Files 37 37
Lines 1112 1112
Branches 225 225
===================================================
+ Hits 938 939 +1
+ Misses 174 173 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* @param deployer Signer to deploy the library. | ||
* @returns The library configuration or an empty object. | ||
*/ | ||
export async function getLibDiamondConfigOrEmpty(deployer: SignerWithAddress): Promise<any> { |
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.
is it possible to type the promise output ?
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.
It generates a typing error so I use the generic type any
.
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 Job 💪🏻
Migration steps:
receive
andfallback
behavior inDiamond.sol
Module
toFacet
in contracts namesDiamond.sol