-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Refactor and fix async operations in ERC2771Context.test.js #5532
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
Refactor and fix async operations in ERC2771Context.test.js #5532
Conversation
|
WalkthroughThe 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)
✅ Passed checks (2 passed)
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.
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 unit tests
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.
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
📒 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
prepareAndSignRequestinstead 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
forwarderAsSignerto simulate short calldata is appropriate.
106-106: Explicit verify before execute: LGTM.
Replaces #5494
PR Checklist
npx changeset add)