Skip to content

feat: enhance meta-tx handler tests with comprehensive coverage for s…#1018

Merged
levalleux-ludo merged 15 commits intomainfrom
meta-tx-mcp
Apr 8, 2026
Merged

feat: enhance meta-tx handler tests with comprehensive coverage for s…#1018
levalleux-ludo merged 15 commits intomainfrom
meta-tx-mcp

Conversation

@levalleux-ludo
Copy link
Copy Markdown
Member

@levalleux-ludo levalleux-ludo commented Apr 2, 2026

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.ts with broad coverage across many signMetaTx* helpers, including assertions for both SignedMetaTx and StructuredData modes.
  • Added returnTypedDataToSign overloads throughout packages/core-sdk/src/meta-tx/handler.ts to return StructuredData when requested.
  • Added corresponding overloads and branching logic in packages/core-sdk/src/meta-tx/mixin.ts to expose the same behavior via the SDK mixin API.

…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.
Copilot AI review requested due to automatic review settings April 2, 2026 16:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts with broad coverage across many signMetaTx* helpers, including assertions for both SignedMetaTx and StructuredData modes.
  • Added returnTypedDataToSign overloads throughout packages/core-sdk/src/meta-tx/handler.ts to return StructuredData when requested.
  • Added corresponding overloads and branching logic in packages/core-sdk/src/meta-tx/mixin.ts to 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
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 99.58333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.49%. Comparing base (95432e5) to head (a83bd54).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/core-sdk/src/meta-tx/mixin.ts 98.48% 1 Missing ⚠️
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     
Flag Coverage Δ
common 92.59% <ø> (ø)
core-sdk 62.63% <99.58%> (+6.19%) ⬆️
e2e 85.24% <70.00%> (-0.56%) ⬇️
eth-connect-sdk 95.06% <ø> (ø)
ethers-sdk 74.45% <ø> (ø)
ipfs-storage 91.75% <ø> (ø)
metadata 94.70% <ø> (ø)
unittests 65.95% <99.58%> (+5.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ levalleux-ludo
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

@levalleux-ludo levalleux-ludo enabled auto-merge (squash) April 8, 2026 15:21
@levalleux-ludo levalleux-ludo disabled auto-merge April 8, 2026 15:25
@levalleux-ludo levalleux-ludo merged commit e7a47d5 into main Apr 8, 2026
12 of 15 checks passed
@levalleux-ludo levalleux-ludo deleted the meta-tx-mcp branch April 8, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants