Skip to content

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Feb 26, 2025

Replaces #5494

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Amxx Amxx added tests Test suite and helpers. ignore-changeset labels Feb 26, 2025
@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2025

⚠️ No Changeset found

Latest commit: 97a720b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Amxx Amxx added this to the 5.5 milestone Jun 10, 2025
@Amxx Amxx requested a review from a team as a code owner September 10, 2025 13:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Walkthrough

The test suite test/metatx/ERC2771Context.test.js introduces a fixture helper prepareAndSignRequest(signer, request) that populates defaults (from, value, data, gas, nonce, deadline) and signs via signTypedData. Tests for msgSender, msgData, and multicall are refactored to build requests with this helper, then call forwarder.verify(req) and forwarder.execute(req). The fixture’s public return is updated to { sender, other, forwarder, forwarderAsSigner, context, prepareAndSignRequest }, removing domain and types. Some assertions are adjusted to use eventually-based patterns.

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately reflects the key changes by stating that the tests in ERC2771Context.test.js were refactored and asynchronous operations were fixed, making it concise, specific to the main change, and clear to readers.
Description Check ✅ Passed The description is relevant to the pull request by referencing the prior PR being replaced and the test checklist, which relates to the changeset even though it omits detailed change descriptions.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
test/metatx/ERC2771Context.test.js (1)

98-104: Fix typo in comment.

"poisonned" → "poisoned".

-        // poisonned call to 'msgSender()'
+        // poisoned call to 'msgSender()'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f8d61c and 97a720b.

📒 Files selected for processing (1)
  • test/metatx/ERC2771Context.test.js (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
test/metatx/ERC2771Context.test.js (3)
test/metatx/ERC2771Forwarder.test.js (6)
  • forwarder (12-12)
  • domain (14-14)
  • ethers (154-157)
  • ethers (183-186)
  • ethers (344-347)
  • ethers (374-377)
test/utils/types/Time.test.js (1)
  • MAX_UINT48 (10-10)
test/helpers/eip712.js (1)
  • domain (11-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: halmos
  • GitHub Check: tests-foundry
  • GitHub Check: coverage
  • GitHub Check: slither
  • GitHub Check: tests-upgradeable
  • GitHub Check: tests
🔇 Additional comments (8)
test/metatx/ERC2771Context.test.js (8)

31-31: Fixture return shape change: LGTM.

Expose prepareAndSignRequest instead of { domain, types } is cleaner for tests.


54-57: Nice consolidation using the helper.

Clear and reduces duplication.


59-59: Explicit verify step reads well.

Keeps failure diagnosis clear before execute.


75-78: Good reuse for msgData case.

Helper usage keeps the test concise.


80-80: Verify before execute: LGTM.


83-83: Asserting with original encoded calldata is correct.


91-91: Direct-call edge case covered cleanly.

Using forwarderAsSigner to simulate short calldata is appropriate.


106-106: Explicit verify before execute: LGTM.

@Amxx Amxx requested a review from ernestognw September 24, 2025 13:55
@ernestognw ernestognw merged commit 7947cec into OpenZeppelin:master Sep 26, 2025
21 checks passed
@Amxx Amxx deleted the chore/cleanup-erc2771context-tests branch September 26, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-changeset tests Test suite and helpers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants