You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: increasing command support for dapp swap comparison (#38546)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Increasing command support for dapp swap comparison
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes: MetaMask/MetaMask-planning#6386
## **Manual testing steps**
1. Submit swap command with required version
2. Ensure that dapp swap comparison works as expected
## **Screenshots/Recordings**
TODO
## **Pre-merge author checklist**
- [X] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've completed the PR template to the best of my ability
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds parsing/handling for V2 exact-in swaps (including batched/native
paths) and expands tests; exact-out still rejected.
>
> - **Core**:
> - Add V2 exact-in ABI to `BASE_COMMANDS_ABI_DEFINITION`
(`V2_SWAP_EXACT_IN`).
> - Register `handleV2CommandSwapExactIn` in parser
(`DAPP_SWAP_COMMANDS_PARSER` maps `08`).
> - Implement `handleV2CommandSwapExactIn` to decode `recipient`,
`amountIn`, `amountOutMin`, and resolve
`srcTokenAddress`/`destTokenAddress` from `path`.
> - **Tests**
(`shared/modules/dapp-swap-comparison/dapp-swap-command-utils.test.ts`):
> - Add V2 exact-in cases: ERC20→ERC20, ERC20→native, native→ERC20, and
batched variants.
> - Expand exact-out suite label to "V4/V3/v2 swaps" and add V2
exact-out scenarios expecting "Exact-out commands are not supported
yet".
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
810c440. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments