test(swap): add gasless swap e2e tests for ETH/USDC to MUSD with 7702 support#27895
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
swapTestSpecificMock registers an empty-string SSE response for MUSD at the default priority 999. In mockttp, FIFO wins at equal priority, so the override calls in the gasless spec were silently losing the race. Passing priority 1000 ensures the actual quote fixture is served. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fe554dd to
8bde2e0
Compare
…ody read to handler Monkey-patch mockttp's CallbackMatcher.matches() to pass the OngoingRequest directly to the callback instead of awaiting waitForCompletedRequest(). This eliminates streamToBuffer calls during rule matching, preventing unhandled 'Aborted' rejections when clients drop connections mid-request. Move the request body read (rawTxs extraction) from the .matching() callback into the .thenCallback() handler where body buffering is safe and fully caught. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
|
racitores
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
gasless-swap.spec.tswith three test scenarios:gasIncluded: true)gasIncluded: true)gasIncluded7702: true)Note
Medium Risk
Medium risk because it monkey-patches
mockttpmatching behavior to suppressError('Aborted')and expands E2E mocking/fixtures; mistakes could hide real errors or affect unrelated tests.Overview
Adds new gasless swap smoke test scenarios for
MUSD, including a live (non-skipped)ETH → MUSDflow usinggasIncluded7702, plus two additional (currently skipped) cases for standard gaslessETH → MUSDandUSDC → MUSDwith approval.Extends swap test fixtures/mocks to support
MUSD(token lists, tokens API response, spot prices) and introduces dedicated quote fixtures for gasless and 7702 quotes (includingtxFeefields required by validators/UI).Hardens E2E mocking by patching
mockttp’smatchesAllto treatError('Aborted')as a non-match, preventing aborted client requests from surfacing as unhandled rejections in Jest, and simplifies swap activity checking by removing an explicit post-toast delay.Written by Cursor Bugbot for commit a0acb80. This will update automatically on new commits. Configure here.