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

Create single functions to invoke Transaction Controller #8366

Conversation

OGPoyraz
Copy link
Member

Description

This PR aims to add single function wrappers for each TransactionController method such as addTransaction and estimateGas.

Related issues

For more detail : https://github.com/MetaMask/mobile-planning/issues/1488

Manual testing steps

No QA needed since there is no functional change

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • [] I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

CI Related Section: DO NOT EDIT

Flag used by Bitrise to either run or skip E2E smoke tests

  • Bitrise Flag:[skip ci]

@OGPoyraz OGPoyraz added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Jan 23, 2024
@OGPoyraz OGPoyraz requested a review from a team as a code owner January 23, 2024 09:00
@OGPoyraz OGPoyraz changed the title Create single functions to invoke transaction controller Create single functions to invoke Transaction Controller Jan 23, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 23, 2024
@github-actions github-actions bot force-pushed the 1488-create-single-functions-to-invoke-transaction-controller-in-mobile branch from ab52715 to c48c16d Compare January 23, 2024 09:03
@OGPoyraz OGPoyraz force-pushed the 1488-create-single-functions-to-invoke-transaction-controller-in-mobile branch from c48c16d to 6281c2e Compare January 30, 2024 13:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2024

Codecov Report

Attention: 26 lines in your changes are missing coverage. Please review.

Comparison is base (ed7041a) 41.43% compared to head (a78085f) 41.47%.

Files Patch % Lines
app/components/Views/confirmations/Send/index.js 0.00% 4 Missing ⚠️
app/components/Nav/Main/index.js 0.00% 3 Missing ⚠️
...s/UI/Notification/TransactionNotification/index.js 0.00% 2 Missing ⚠️
app/components/UI/Swaps/QuotesView.js 0.00% 2 Missing ⚠️
app/components/UI/Transactions/index.js 0.00% 2 Missing ⚠️
...Settings/NetworksSettings/NetworkSettings/index.js 0.00% 2 Missing ⚠️
...omponents/Views/Settings/NetworksSettings/index.js 0.00% 2 Missing ⚠️
...ponents/UI/LedgerModals/LedgerTransactionModal.tsx 0.00% 1 Missing ⚠️
app/components/Views/Asset/index.js 0.00% 1 Missing ⚠️
...mponents/Views/NetworkSelector/NetworkSelector.tsx 0.00% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8366      +/-   ##
==========================================
+ Coverage   41.43%   41.47%   +0.04%     
==========================================
  Files        1254     1255       +1     
  Lines       30570    30577       +7     
  Branches     3001     3001              
==========================================
+ Hits        12667    12683      +16     
+ Misses      17150    17141       -9     
  Partials      753      753              

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

vinistevam
vinistevam previously approved these changes Jan 31, 2024
Copy link
Contributor

@vinistevam vinistevam left a comment

Choose a reason for hiding this comment

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

Great work @OGPoyraz !
I don't know if you already run the smoke test in Bitrise, in case not, you can use the tag Run Smoke E2E.

ow, I think might be out of the scope as it's a utility function but reviewing your PR I just saw isEIP1559Transaction here in case you need to push some change we could fix that import as this function is already exported now.

@OGPoyraz OGPoyraz added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 31, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f2198355-549c-4198-bfe3-db841c59bddc
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@OGPoyraz
Copy link
Member Author

Thanks @vinistevam , fixed the import, I think still worth running smoke e2e pipeline, I was fixing unit tests but it's good to go now.

vinistevam
vinistevam previously approved these changes Feb 15, 2024
matthewwalsh0
matthewwalsh0 previously approved these changes Feb 16, 2024
@OGPoyraz
Copy link
Member Author

@sleepytanya this passing on Bitrise but a transaction regression would be awesome here

matthewwalsh0
matthewwalsh0 previously approved these changes Feb 19, 2024
@M111111111r

This comment was marked as spam.

@sleepytanya
Copy link
Contributor

sleepytanya commented Feb 20, 2024

@OGPoyraz QA build, physical device Samsung s24+, Sepolia, Linea Goerli and mainnet for swaps:

  • Transactions - send native token origin MM
  • Transactions - send native token origin dapp
  • Transactions - send ERC20 token origin MM
  • Transactions - send ERC20 token origin dapp
  • Transactions - send ERC721 token origin MM
  • Transactions - send ERC721 token origin dapp
  • Transactions - speed up transaction
  • Transactions - Cancel transaction doesn't work https://recordit.co/s6nFUNgejV
  • Tokens - import ERC20 token origin MM
  • Tokens - import ERC20 token origin dapp
  • Tokens - import ERC721 token origin MM (NFT image is not shown, not related to current branch)
  • Tokens - import ERC721 token origin dapp ('watch NFT', 'watch all NFTs' are not responsive, not related to current branch)
  • Tokens - import ERC1155 token origin MM
  • Tokens - import ERC1155 token origin dapp
  • Tokens - approve ERC1155 token
  • Tokens - approve ERC20 token
  • Tokens - approve ERC721 token
  • ENS - name resolution (works on mainnet only, the same way it works on extension)
  • Gas fee - EIP-1559 gas
  • Gas fee - legacy gas
  • Sign - eth sign
  • Sign - personal sign
  • Sign - sign in with ethereum
  • Sign - sign typed with data
  • Permissions - connecting and disconnecting from a dapp
  • Swap - swap eth
  • Incoming transactions history
  • custom nonce
  • cancel transaction using custom nonce
  • [ ] stuck multiple transactions (cancel / speed up) - cancelling doesn't work

@OGPoyraz
Copy link
Member Author

Very nice catch @sleepytanya ! I believe cancel transaction should work now

@sleepytanya
Copy link
Contributor

QA build, physical Android Samsung s24+ - 'cancel' works as expected:
https://recordit.co/aAn7yttxEE

matthewwalsh0
matthewwalsh0 previously approved these changes Feb 20, 2024
matthewwalsh0
matthewwalsh0 previously approved these changes Feb 21, 2024
@OGPoyraz OGPoyraz force-pushed the 1488-create-single-functions-to-invoke-transaction-controller-in-mobile branch from 1156c9b to a78085f Compare February 22, 2024 09:04
Copy link

sonarcloud bot commented Feb 22, 2024

@OGPoyraz OGPoyraz merged commit ca5dc68 into main Feb 22, 2024
28 checks passed
@OGPoyraz OGPoyraz deleted the 1488-create-single-functions-to-invoke-transaction-controller-in-mobile branch February 22, 2024 09:51
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
@metamaskbot metamaskbot added the release-7.18.0 Issue or pull request that will be included in release 7.18.0 label Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.18.0 Issue or pull request that will be included in release 7.18.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants