Skip to content
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

fix (cherry-pick for v12.0.0): disable STX for swap+send approvals #25512

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

BZahory
Copy link
Contributor

@BZahory BZahory commented Jun 25, 2024

Description

Cherry picks #25510

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

<!--
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**

Paired w/ @dan437 and @forest-diggs-consensys 

We removed STX functionality for Swap+Send in #25422. However, we still
get the STX flow because the `swapApproval` type we use is still routed
as an STX.

Since only Swap+Send uses the `swapApproval` type for STXs routed
through `submitSmartTransactionHook`, we can exclude it in the same way
we excluded the `swapAndSend` type in #25422.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25510?quickstart=1)

## **Related issues**

Fixes: #25356

## **Manual testing steps**

1. Enable Smart Transactions in settings
2. Switch to Ethereum Mainnet
3. Submit a swap+send transaction that requires an approval (i.e. from
an ERC-20 w/o an existing approval)
4. Ensure that the STX screen does not show after submitting
5. Ensure that the contract interaction isn't marked as "unapproved"

## **Screenshots/Recordings**

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

### **Before**


https://github.com/MetaMask/metamask-extension/assets/44588480/d3fb13ca-4aa0-43a8-8689-37f7e49af10a

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

### **After**


https://github.com/MetaMask/metamask-extension/assets/44588480/d34ab118-ed69-4418-8c35-06774099e092

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

## **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/develop/.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/develop/.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.
@BZahory BZahory requested review from a team and kumavis as code owners June 25, 2024 16:54
Copy link
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.

@BZahory BZahory changed the base branch from develop to Version-v12.0.0 June 25, 2024 16:54
@BZahory BZahory changed the title Version v12.0.0 swap send approval stx fix (cherry-pick for v12.0.0): disable STX for swap+send approvals Jun 25, 2024
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Not sure why design system is tagged as reviwer here but approving to unblock on behalf of @MetaMask/design-system

@danjm danjm merged commit f538723 into Version-v12.0.0 Jun 26, 2024
75 of 77 checks passed
@danjm danjm deleted the Version-v12.0.0-swap-send-approval-stx branch June 26, 2024 19:34
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2024
@metamaskbot metamaskbot added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 26, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.0.0 on PR, as PR was cherry-picked in branch 12.0.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.0.0 Issue or pull request that will be included in release 12.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants