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: do not use STX for swap+send approval #25510

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Conversation

BZahory
Copy link
Contributor

@BZahory BZahory commented Jun 25, 2024

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.

Open in GitHub Codespaces

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

Before

Screen.Recording.2024-06-25.at.12.16.52.PM.mov

After

Screen.Recording.2024-06-25.at.12.13.25.PM.mov

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.

@BZahory BZahory requested a review from a team as a code owner June 25, 2024 16:19
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.

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.65%. Comparing base (1cc54f6) to head (84c5f98).

Files Patch % Lines
app/scripts/lib/transaction/smart-transactions.ts 66.67% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25510      +/-   ##
===========================================
- Coverage    69.65%   69.65%   -0.00%     
===========================================
  Files         1347     1347              
  Lines        47803    47805       +2     
  Branches     13184    13186       +2     
===========================================
+ Hits         33296    33297       +1     
- Misses       14507    14508       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BZahory BZahory merged commit 7add8ac into develop Jun 25, 2024
75 of 76 checks passed
@BZahory BZahory deleted the prevent-swap-send-stx branch June 25, 2024 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 25, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [84c5f98]
Page Load Metrics (139 ± 185 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62181862311
domContentLoaded9231342
load411818139385185
domInteractive9231342
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

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