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: Disable Smart Transactions for the new Send&Swap feature #25422

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Jun 19, 2024

Description

Disables Smart Transactions for the new Send&Swap feature, since we don't support it there yet. Support will be added in one of the upcoming releases.

Related issues

Fixes:

Manual testing steps

  1. Go to the Send feature
  2. Choose a different destination token, which will make the transaction type "swapAndSend"
  3. Submit it. In the background Network tab you can see it's not submitted via Smart Transactions, but as a regular transaction instead

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.

@dan437 dan437 added the team-transactions Transactions team label Jun 19, 2024
@dan437 dan437 requested a review from a team as a code owner June 19, 2024 14:20
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.

@dan437 dan437 changed the title Disable Smart Transactions for the new Send&Swap feature fix: Disable Smart Transactions for the new Send&Swap feature Jun 19, 2024
@@ -120,9 +121,16 @@ class SmartTransactionHook {
}

async submit() {
const isUnsupportedTransactionTypeForSmartTransaction =
this.#transactionMeta.type &&
[TransactionType.swapAndSend].includes(this.#transactionMeta.type);
Copy link
Contributor

@BZahory BZahory Jun 19, 2024

Choose a reason for hiding this comment

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

Could simplify to this.#transactionMeta?.type === TransactionType.swapAndSend

BZahory
BZahory previously approved these changes Jun 19, 2024
@dan437 dan437 force-pushed the disable-stx-for-send-and-swap branch from 49986d9 to df09d84 Compare June 19, 2024 15:06
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.92%. Comparing base (f5a3437) to head (df09d84).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25422   +/-   ##
========================================
  Coverage    64.92%   64.92%           
========================================
  Files         1382     1382           
  Lines        54764    54768    +4     
  Branches     14369    14371    +2     
========================================
+ Hits         35551    35555    +4     
  Misses       19213    19213           

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

@metamaskbot
Copy link
Collaborator

Builds ready [df09d84]
Page Load Metrics (56 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7111386105
domContentLoaded10141111
load43835694
domInteractive9141111
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 252 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@dan437 dan437 merged commit 97b7303 into develop Jun 19, 2024
74 checks passed
@dan437 dan437 deleted the disable-stx-for-send-and-swap branch June 19, 2024 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2024
@metamaskbot metamaskbot added release-12.1.0 Issue or pull request that will be included in release 12.1.0 release-12.0.0 Issue or pull request that will be included in release 12.0.0 and removed release-12.1.0 Issue or pull request that will be included in release 12.1.0 labels Jun 19, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-12.0.0 on PR. Adding release label release-12.0.0 on PR and removing other release labels(release-12.1.0), 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 team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants