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: Update assets controllers v14 #9182

Merged
merged 38 commits into from
Apr 12, 2024
Merged

Conversation

tommasini
Copy link
Contributor

@tommasini tommasini commented Apr 9, 2024

Description

This PR addresses the update to the Asset Controller v14

Created Core branch to address patch changes: patch/mobile-assets-controllers-v-14-0-0

Fixed issue of token being automatically imported when requested by a dapp.

Changed breaking changes on addToken and watchAsset function signature.

Important to note that this version of assets controller is pointing to version 5 of controller utils, therefore the auto detect tokens will only be available when this PR is merged

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/1620

Manual testing steps

  1. imported tokens on mainnet
  2. Imported tokens on custom network
  3. Auto-detect tokens on mainnet & custom network
  4. Import token via dapp

Screenshots/Recordings

Auto detect tokens, import token via dapp:

Screen.Recording.2024-04-11.at.10.13.51.mov

Add custom token/ hide token:

Screen.Recording.2024-04-11.at.10.14.44.mov

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

tommasini and others added 29 commits March 26, 2024 19:31
…o delete networkId property from the network controller state and added a network id property to our own internal property, created the reducer and the action for that property and added the dispatch to the engine event subscriber, update the patch of network controller, updated test cases and initial states with new data structure with the networkId property
…only look for network id when the network did change
…ion we do not need to ensure was being called with the right argument, we have separate unit tests for that function
…etworkProvider that will contain our internal property regarding a network provider, updated on the migrations files, backgroundBridge and related components, the test files were updated accordingly as well. On Engine file was added a subscribe of the networkWillChange event to make sure we have the networkId property reseted if the intention of switching starts
… want to investigate any issue, this is the better approach to not polute Sentry and save it for the investigations
…ageProvider with the property networkId, updated files with the new property inpageProvider, deleting old actions and reducers files about networkProvider, addressed review on unit tests, changed initial root state and fixture builder initial state with the inpageProvider, and updated respective migrations 033 and 037 with reviews and new property, updated also engine file imports with the action of the slice of inpageprovider
… fresh install the networkId would not be updated because the event network did change did not trigger
@tommasini tommasini requested a review from a team as a code owner April 9, 2024 23:45
@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 11, 2024
Copy link
Contributor

github-actions bot commented Apr 11, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 8f5dfa8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/905699a7-ba3b-48e8-bd7d-729e7c2d1e3c

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

wachunei
wachunei previously approved these changes Apr 11, 2024
Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

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

Changes in app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts LGTM

@bergeron bergeron self-requested a review April 11, 2024 17:55
@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 12, 2024
Copy link
Contributor

github-actions bot commented Apr 12, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 8b20aee
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5b608280-b1ae-4486-8216-e3bcece7619f

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link
Contributor

@bergeron bergeron 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 to me! Tested detecting and importing tokens. switching accounts / chains. And my recent patch for linea pricing.

As the PR description mentions, NFT detection requires #9149

Copy link
Contributor

@blackdevelopa blackdevelopa left a comment

Choose a reason for hiding this comment

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

code lgtm

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 12, 2024
Copy link
Contributor

@NicolasMassart NicolasMassart 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 to me.

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 12, 2024
Copy link
Contributor

github-actions bot commented Apr 12, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: f9259b3
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0ed755fa-627a-4344-860f-b002a2b90cd5

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 12, 2024
Copy link
Contributor

github-actions bot commented Apr 12, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 53e5ccf
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c0e3b5cc-617c-453d-a3dd-b68616e62d21

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Apr 12, 2024

@tommasini tommasini merged commit add9096 into main Apr 12, 2024
34 of 35 checks passed
@tommasini tommasini deleted the update/1620-assets-controllers-v14 branch April 12, 2024 13:11
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Apr 12, 2024
@metamaskbot metamaskbot added the release-7.22.0 Issue or pull request that will be included in release 7.22.0 label Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.22.0 Issue or pull request that will be included in release 7.22.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants