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

chore: smart-transactions code domain #26948

Merged
merged 16 commits into from
Sep 18, 2024
Merged

chore: smart-transactions code domain #26948

merged 16 commits into from
Sep 18, 2024

Conversation

dbrans
Copy link
Contributor

@dbrans dbrans commented Sep 5, 2024

Description

This PR establishes the ui/pages/smart-transactions code domain, following the guidance in this proposal.

Moved To ui/pages/smart-transactions/
ui/components/app/smart-transactions/smart-transactions-opt-in-modal.tsx components/smart-transactions-opt-in-modal.tsx

The following files will be left in place.

Left in place Reason
app/scripts/lib/transaction/smart-transactions.ts background code
shared/constants/smartTransactions.ts shared with background
ui/components/app/transaction-list-item/smart-transaction-list-item.component.js Specific to the transaction list.
ui/pages/confirmations/confirmation/templates/smart-transaction-status-page.js Belongs with other confirmation templates.
ui/pages/swaps/smart-transaction-status/smart-transaction-status.js Swaps-focused. Will be replaced by regular STX status screen once swaps moves to regular STX.

STX-related code in other files

The following files contain stx-related code, which may be extracted and moved into the smart-transactions code domain at a later time.

Path STX-Related Code
app/scripts/metamask-controller.js We use the STX controller there new SmartTransactionsController. *// Smart Transactions section*
ui/ducks/swaps/swaps.js A few functions related to STX: fetchSmartTransactionsLiveness, signAndSendSmartTransaction, setSmartTransactionsRefreshInterval, etc.
ui/store/actions.ts fetchSmartTransactionsLiveness and other STX functions
ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js STX is used from this component
ui/pages/settings/advanced-tab/advanced-tab.component.js Advanced Settings that include STX option
ui/pages/swaps/swaps.util.ts getFeeForSmartTransaction
ui/pages/swaps/prepare-swap-page/review-quote.js Uses STX in Swaps
ui/selectors/transactions.js allowedSwapsSmartTransactionStatusesForActivityList

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Installed extension
  2. Added account with crypto
  3. Verify STX opt-in-modal
  4. Send a smart transaction

Screenshots/Recordings

Before

After

image

image

image

image

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.

@dbrans dbrans requested review from a team as code owners September 5, 2024 20:01
Copy link
Contributor

github-actions bot commented Sep 5, 2024

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.

@github-actions github-actions bot added the team-transactions Transactions team label Sep 5, 2024
@dbrans dbrans marked this pull request as draft September 5, 2024 20:14
@metamaskbot
Copy link
Collaborator

Builds ready [24fe0cf]
Page Load Metrics (1557 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint20119571427422203
domContentLoaded13981946153714067
load14061957155714168
domInteractive14140412914
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 69 Bytes (0.00%)
  • ui: -131 Bytes (-0.00%)
  • common: 157 Bytes (0.00%)

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.01%. Comparing base (e7df8e2) to head (d91bac2).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26948   +/-   ##
========================================
  Coverage    70.01%   70.01%           
========================================
  Files         1445     1445           
  Lines        50194    50194           
  Branches     14041    14041           
========================================
  Hits         35139    35139           
  Misses       15055    15055           

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

@dbrans dbrans marked this pull request as ready for review September 6, 2024 13:13
@dbrans dbrans requested a review from a team as a code owner September 6, 2024 13:13
@dbrans dbrans changed the title chore: stx code domain chore: smart-transactions code domain Sep 6, 2024
@dbrans dbrans requested a review from dan437 September 6, 2024 13:28
@@ -51,7 +51,7 @@
@import 'recovery-phrase-reminder/index';
@import 'step-progress-bar/index.scss';
@import 'selected-account/index';
@import 'smart-transactions/index';
@import '../../pages/smart-transactions/components/index.scss';
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any other import from ../../pages in this component. Shouldn't we remove it from here and import it somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call!

@metamaskbot
Copy link
Collaborator

Builds ready [ecb356e]
Page Load Metrics (1896 ± 131 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22123281748572275
domContentLoaded139422711864274131
load140123091896274131
domInteractive116835167
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 20 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [5565348]
Page Load Metrics (1939 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26922771658551265
domContentLoaded16922412190620297
load17012453193920699
domInteractive157741209
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 20 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

sonarcloud bot commented Sep 17, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [d91bac2]
Page Load Metrics (1946 ± 108 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29327601862436209
domContentLoaded165625111911211102
load166726281946226108
domInteractive1510438199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 20 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@dan437 dan437 left a comment

Choose a reason for hiding this comment

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

Looks good!

@dbrans dbrans merged commit 1a6f212 into develop Sep 18, 2024
78 checks passed
@dbrans dbrans deleted the djb/stx-code-domain branch September 18, 2024 12:39
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 18, 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.

5 participants