Skip to content

Commit

Permalink
chore: upgrade assets-controllers to v38 (#12116)
Browse files Browse the repository at this point in the history
## **Description**

Upgrades assets-controllers to v38
Also adds a patch for :
https://github.com/MetaMask/core/pull/4821/files#diff-3336d65a4d2c1e5af90f22e16feb058f327960796b135308bca9ed8415418f5d

## **Related issues**

Fixes:
Related to:
https://github.com/MetaMask/core/pull/4821/files#diff-3336d65a4d2c1e5af90f22e16feb058f327960796b135308bca9ed8415418f5d

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.
  • Loading branch information
sahar-fehri authored Nov 1, 2024
1 parent 0e7606f commit 771100f
Show file tree
Hide file tree
Showing 5 changed files with 555 additions and 516 deletions.
13 changes: 2 additions & 11 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ export class Engine {
networkController.initializeProvider();

const assetsContractController = new AssetsContractController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'AssetsContractController',
allowedActions: [
Expand Down Expand Up @@ -619,8 +618,7 @@ export class Engine {
chainId: networkController.getNetworkClientById(
networkController?.state.selectedNetworkClientId,
).configuration.chainId,
useIPFSSubdomains: false,
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
useIpfsSubdomains: false,
messenger: this.controllerMessenger.getRestricted({
name: 'NftController',
allowedActions: [
Expand Down Expand Up @@ -659,9 +657,9 @@ export class Engine {
chainId: networkController.getNetworkClientById(
networkController?.state.selectedNetworkClientId,
).configuration.chainId,
// @ts-expect-error at this point in time the provider will be defined by the `networkController.initializeProvider`
provider: networkController.getProviderAndBlockTracker().provider,
state: initialState.TokensController,
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'TokensController',
allowedActions: [
Expand All @@ -687,15 +685,13 @@ export class Engine {
AppConstants.NETWORK_STATE_CHANGE_EVENT,
listener,
),
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'TokenListController',
allowedActions: [`${networkController.name}:getNetworkClientById`],
allowedEvents: [`${networkController.name}:stateChange`],
}),
});
const currencyRateController = new CurrencyRateController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'CurrencyRateController',
allowedActions: [`${networkController.name}:getNetworkClientById`],
Expand Down Expand Up @@ -935,7 +931,6 @@ export class Engine {
});

const accountTrackerController = new AccountTrackerController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions
messenger: this.controllerMessenger.getRestricted({
name: 'AccountTrackerController',
allowedActions: [
Expand Down Expand Up @@ -1458,7 +1453,6 @@ export class Engine {
tokensController,
tokenListController,
new TokenDetectionController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'TokenDetectionController',
allowedActions: [
Expand Down Expand Up @@ -1503,7 +1497,6 @@ export class Engine {
}),

new NftDetectionController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'NftDetectionController',
allowedEvents: [
Expand All @@ -1527,7 +1520,6 @@ export class Engine {
phishingController,
preferencesController,
new TokenBalancesController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'TokenBalancesController',
allowedActions: [
Expand All @@ -1544,7 +1536,6 @@ export class Engine {
state: initialState.TokenBalancesController,
}),
new TokenRatesController({
// @ts-expect-error TODO: Resolve mismatch between base-controller versions.
messenger: this.controllerMessenger.getRestricted({
name: 'TokenRatesController',
allowedActions: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"@metamask/accounts-controller": "^18.2.1",
"@metamask/address-book-controller": "^6.0.1",
"@metamask/approval-controller": "^7.1.0",
"@metamask/assets-controllers": "^37.0.0",
"@metamask/assets-controllers": "^38.3.0",
"@metamask/base-controller": "^7.0.1",
"@metamask/composable-controller": "^3.0.0",
"@metamask/contract-metadata": "^2.1.0",
Expand Down
Loading

0 comments on commit 771100f

Please sign in to comment.