-
Notifications
You must be signed in to change notification settings - Fork 14
feat: enhance isDatasetCompatibleWithDeal function to return with a reason
#267
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
feat: enhance isDatasetCompatibleWithDeal function to return with a reason
#267
Conversation
Added a new public view function `isDatasetCompatibleWithDeal` to verify the compatibility of a dataset order with a deal. This function includes multiple checks such as deal existence, dataset order owner signature, and restrictions on app, workerpool, and requester. Removed the `Matching` struct from `IexecPoco1Facet` and moved it to the `IexecPoco1` interface.
…ility Removed redundant comment in `IexecPoco1Facet` and added comprehensive tests for the new `isDatasetCompatibleWithDeal` function. The tests cover various scenarios including compatibility checks, invalid signatures, and restrictions on dataset orders.
Introduced a new script to deploy and update the IexecPocoAccessorsFacet and IexecPoco1Facet. The script handles the deployment of new facets, removal of old facets, and updates the diamond proxy accordingly. It includes checks for required deployment options and logs the process for better traceability.
Refactored tests for the `isDatasetCompatibleWithDeal` function to improve clarity and coverage. Removed the creation of an incompatible dataset order and added checks for non-existent deals and deals that already have datasets. Updated test cases to ensure accurate validation of dataset order compatibility, including scenarios for incompatible app restrictions and tags.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: gfournieriExec <[email protected]>
…and IexecPoco1Facet
…acets in upgrade script
Co-authored-by: gfournieriExec <[email protected]>
Co-authored-by: gfournieriExec <[email protected]>
…e and update tests
…ailed status for compatibility checks
Co-authored-by: Zied Guesmi <[email protected]>
…in IexecPoco1Facet
Co-authored-by: Zied Guesmi <[email protected]>
Co-authored-by: Zied Guesmi <[email protected]>
…feature/add-isDatasetCompatibleWithDeal-function-part2
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #267 +/- ##
==========================================
+ Coverage 83.66% 84.83% +1.17%
==========================================
Files 38 37 -1
Lines 1218 1240 +22
Branches 227 235 +8
==========================================
+ Hits 1019 1052 +33
+ Misses 199 188 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
isDatasetCompatibleWithDeal function to revert with a reason
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 enhances the isDatasetCompatibleWithDeal function to return both a boolean result and a string reason for why compatibility checks fail, improving error reporting and debugging capabilities.
- Modifies function signature to return a tuple
(bool result, string memory reason)instead of justbool - Updates all compatibility check failure points to return specific error messages
- Updates all tests to verify both the boolean result and the specific error reason
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| contracts/interfaces/IexecPoco1.v8.sol | Updates interface signature to return both result and reason |
| contracts/interfaces/IexecPoco1.sol | Updates interface signature to return both result and reason |
| contracts/facets/IexecPoco1Facet.sol | Implements enhanced function with specific error messages for each failure case |
| test/byContract/IexecPoco/IexecPoco1.test.ts | Updates all test cases to destructure and verify both result and reason values |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
isDatasetCompatibleWithDeal function to revert with a reasonisDatasetCompatibleWithDeal function to return with a reason
…feature/add-isDatasetCompatibleWithDeal-function-part2
Co-authored-by: Zied Guesmi <[email protected]>
…CompatibleWithDeal-function-part2
…d add new `IexecPocoBoost` functions
zguesmi
left a comment
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.
All good 👍
No description provided.