feat: enhance meta-tx handler tests with comprehensive coverage for s…#1018
feat: enhance meta-tx handler tests with comprehensive coverage for s…#1018levalleux-ludo merged 15 commits intomainfrom
Conversation
…igning functions - Added tests for various signing functions including signMetaTx, signMetaTxCreateSeller, signMetaTxUpdateSeller, and others. - Implemented assertions for signed meta transactions and structured data. - Introduced shared constants and helper functions to streamline test setup. - Updated existing tests to utilize new constants and improve readability. - Ensured compatibility with Biconomy paths in relevant test cases.
There was a problem hiding this comment.
Pull request overview
Adds support and test coverage for returning EIP-712 typed data (StructuredData) from core meta-tx signing helpers, alongside existing SignedMetaTx outputs, improving SDK ergonomics for clients that want to sign externally.
Changes:
- Expanded
packages/core-sdk/tests/meta-tx/handler.test.tswith broad coverage across manysignMetaTx*helpers, including assertions for both SignedMetaTx and StructuredData modes. - Added
returnTypedDataToSignoverloads throughoutpackages/core-sdk/src/meta-tx/handler.tsto returnStructuredDatawhen requested. - Added corresponding overloads and branching logic in
packages/core-sdk/src/meta-tx/mixin.tsto expose the same behavior via the SDK mixin API.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core-sdk/tests/meta-tx/handler.test.ts | Adds comprehensive tests for multiple meta-tx signing functions, validating both SignedMetaTx outputs and returned EIP-712 structured data. |
| packages/core-sdk/src/meta-tx/mixin.ts | Introduces overloads and branching to return StructuredData when returnTypedDataToSign: true is provided. |
| packages/core-sdk/src/meta-tx/handler.ts | Implements returnTypedDataToSign overloads across many signer helpers and propagates typed-data generation via prepareDataSignatureParameters. |
| .gitignore | Ignores .claude directory. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
+ Coverage 90.96% 91.49% +0.52%
==========================================
Files 179 179
Lines 7297 7451 +154
Branches 1366 1433 +67
==========================================
+ Hits 6638 6817 +179
+ Misses 659 634 -25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ge in meta transaction signing
Agent-Logs-Url: https://github.com/bosonprotocol/core-components/sessions/aabe43be-8339-4df3-8e78-18e865c3f825 Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
|
|
…en with overloads for returnTypedDataToSign; add comprehensive tests for both functions
…ignedMetaTx instead of StructuredData - Changed return type of signNativeMetaTx and signNativeMetaTxApproveExchangeToken functions to UnsignedMetaTx. - Updated implementation to include functionName and functionSignature in the returned UnsignedMetaTx. - Modified tests to assert against UnsignedMetaTx instead of StructuredData, ensuring correct structure and presence of new fields. - Adjusted mixin methods to align with the updated return types and assertions.
Adds support and test coverage for returning EIP-712 typed data (StructuredData) from core meta-tx signing helpers, alongside existing SignedMetaTx outputs, improving SDK ergonomics for clients that want to sign externally.
Changes:
packages/core-sdk/tests/meta-tx/handler.test.tswith broad coverage across manysignMetaTx*helpers, including assertions for both SignedMetaTx and StructuredData modes.returnTypedDataToSignoverloads throughoutpackages/core-sdk/src/meta-tx/handler.tsto returnStructuredDatawhen requested.packages/core-sdk/src/meta-tx/mixin.tsto expose the same behavior via the SDK mixin API.