Skip to content

Commit

Permalink
fix: cp-7.41.0 Temporarily revert gas included swaps (#13639)
Browse files Browse the repository at this point in the history
## **Description**
Reverts #13430 for now.

We initially believed that resolving the known issue with gas-included
swaps requiring token approval would be easy and could be completed
before the release candidate for version 7.41.0 was pushed to
production, but it turns out that more fundamental changes are needed.
Specifically, submitBatch support from the
TransactionController—allowing the simultaneous submission of multiple
transactions (approval and swap)—is required. This submitBatch support
will likely also be used for current swaps that need token approval to
increase success rates.

## **Related issues**

Fixes: #13584 

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/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.
  • Loading branch information
dan437 authored Feb 21, 2025
1 parent 4776521 commit 7f31286
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 797 deletions.
6 changes: 2 additions & 4 deletions app/components/Nav/Main/RootRPCMethodsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ const RootRPCMethodsUI = (props) => {
quote_vs_executionRatio: quoteVsExecutionRatio,
token_to_amount_received: tokenToAmountReceived.toString(),
is_smart_transaction: props.shouldUseSmartTransaction,
gas_included: analyticsParams.isGasIncludedTrade,
...smartTransactionMetricsProperties,
available_quotes: analyticsParams.available_quotes,
best_quote_source: analyticsParams.best_quote_source,
Expand Down Expand Up @@ -337,7 +336,7 @@ const RootRPCMethodsUI = (props) => {
transactionId: transactionMeta.id,
deviceId,
// eslint-disable-next-line no-empty-function
onConfirmationComplete: () => {},
onConfirmationComplete: () => { },
type: 'signTransaction',
}),
);
Expand Down Expand Up @@ -407,8 +406,7 @@ const RootRPCMethodsUI = (props) => {
data &&
data !== '0x' &&
to &&
(await getMethodData(data, networkClientId)).name ===
TOKEN_METHOD_TRANSFER
(await getMethodData(data, networkClientId)).name === TOKEN_METHOD_TRANSFER
) {
let asset = props.tokens.find(({ address }) =>
toLowerCaseEquals(address, to),
Expand Down
Loading

0 comments on commit 7f31286

Please sign in to comment.