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

feat: Enable gas included swaps #27427

Merged
merged 14 commits into from
Oct 1, 2024
Merged

feat: Enable gas included swaps #27427

merged 14 commits into from
Oct 1, 2024

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Sep 26, 2024

Description

Users who don't have enough ETH to pay for gas fees while swapping will be able to swap now if the gas fee can be taken from one of the tokens they are swapping. Smart transactions must be enabled for this.

Open in GitHub Codespaces

Related issues

Manual testing steps

Important: updated backend services must be used for this.

  1. Enable Smart Transactions in Advanced Settings
  2. Have e.g. 0 ETH and 100 USDC
  3. Fill in the swap form with USDC -> ETH
  4. You will see that the Swap button is enabled now is there is a slightly different UI for it (see the screenshot section)

Screenshots/Recordings

image

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 Sep 26, 2024
@dan437 dan437 requested review from a team as code owners September 26, 2024 14:59
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.

@metamaskbot
Copy link
Collaborator

Builds ready [d43efe7]
Page Load Metrics (1774 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15612388177519393
domContentLoaded15442338174918488
load15522391177419794
domInteractive267643157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 2.72 KiB (0.04%)
  • common: 922 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [ab8a9fa]
Page Load Metrics (1781 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15732201178415474
domContentLoaded15542111173413364
load15732207178115675
domInteractive15198503818
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 2.72 KiB (0.04%)
  • common: 922 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [cd431be]
Page Load Metrics (2294 ± 207 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26428671980743357
domContentLoaded163935712250433208
load164535882294431207
domInteractive16112492411
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 2.79 KiB (0.04%)
  • common: 922 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [f345436]
Page Load Metrics (1789 ± 91 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15472167178218991
domContentLoaded15372110175918488
load15452127178918991
domInteractive238341178
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 2.8 KiB (0.04%)
  • common: 922 Bytes (0.01%)

app/_locales/en/messages.json Outdated Show resolved Hide resolved
app/_locales/en/messages.json Show resolved Hide resolved
app/_locales/en/messages.json Show resolved Hide resolved
app/_locales/en/messages.json Show resolved Hide resolved
test/jest/mock-store.js Outdated Show resolved Hide resolved
ui/pages/swaps/prepare-swap-page/review-quote.js Outdated Show resolved Hide resolved
ui/pages/swaps/prepare-swap-page/review-quote.js Outdated Show resolved Hide resolved
ui/pages/swaps/prepare-swap-page/review-quote.js Outdated Show resolved Hide resolved
ui/store/actions.ts Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [6aac2e8]
Page Load Metrics (1838 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16692116183510953
domContentLoaded16142107181111254
load16222119183811856
domInteractive167442157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.19 KiB (0.04%)
  • common: 903 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [fe6b349]
Page Load Metrics (1755 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15682095175716479
domContentLoaded15542085171715876
load15692095175516177
domInteractive22151462814
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.26 KiB (0.04%)
  • common: 856 Bytes (0.01%)

@dan437 dan437 force-pushed the gas-included-swaps branch 3 times, most recently from e770fef to adb2a14 Compare October 1, 2024 12:13
@dan437 dan437 force-pushed the gas-included-swaps branch from adb2a14 to 23d01e9 Compare October 1, 2024 12:41
test/jest/mock-store.js Outdated Show resolved Hide resolved
ui/pages/swaps/prepare-swap-page/review-quote.test.js Outdated Show resolved Hide resolved
ui/store/actions.ts Outdated Show resolved Hide resolved
Co-authored-by: Derek Brans <[email protected]>
@metamaskbot
Copy link
Collaborator

Builds ready [23d01e9]
Page Load Metrics (1636 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30621521569327157
domContentLoaded13572078161914570
load13642161163615775
domInteractive15195373818
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.18 KiB (0.04%)
  • common: 842 Bytes (0.01%)

infiniteflower
infiniteflower previously approved these changes Oct 1, 2024
Copy link

sonarqubecloud bot commented Oct 1, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
77.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@infiniteflower infiniteflower self-requested a review October 1, 2024 15:40
@metamaskbot
Copy link
Collaborator

Builds ready [1c02d9f]
Page Load Metrics (1815 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31525121668482232
domContentLoaded16342257179215976
load16452342181516981
domInteractive26633894
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.18 KiB (0.04%)
  • common: 842 Bytes (0.01%)

@dan437 dan437 merged commit facf905 into develop Oct 1, 2024
76 of 77 checks passed
@dan437 dan437 deleted the gas-included-swaps branch October 1, 2024 16:03
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Oct 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants