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: bump assets-controllers to v37 #26984

Merged
merged 36 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1b874ef
chore: bump assets-controllers to v37
sahar-fehri Sep 9, 2024
8605106
Update LavaMoat policies
metamaskbot Sep 9, 2024
e1b952e
fix: make async getAssetImageURL
sahar-fehri Sep 9, 2024
e6a2835
fix: unit test
sahar-fehri Sep 9, 2024
b04727b
fix: unit test
sahar-fehri Sep 9, 2024
30e7e36
fix: lint
sahar-fehri Sep 9, 2024
8aac12e
fix: rm log
sahar-fehri Sep 10, 2024
8d7d88e
fix: rename fct
sahar-fehri Sep 10, 2024
6ca9c85
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
legobeat Sep 10, 2024
5f9cfb1
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 10, 2024
420a435
fix: refactor
sahar-fehri Sep 10, 2024
c952085
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 10, 2024
e017395
fix: add unit test
sahar-fehri Sep 10, 2024
61b19ad
fix: fix test
sahar-fehri Sep 10, 2024
07e6316
fix: fix test
sahar-fehri Sep 10, 2024
72e42ac
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 10, 2024
18b4857
fix: fix
sahar-fehri Sep 10, 2024
24b0477
fix: fix
sahar-fehri Sep 11, 2024
753f884
fix: fix test
sahar-fehri Sep 11, 2024
3dfc697
fix: add test
sahar-fehri Sep 11, 2024
6e9ba75
fix: fix merge conflicts
sahar-fehri Sep 11, 2024
b8f814a
fix: fix lint
sahar-fehri Sep 11, 2024
800891c
Update LavaMoat policies
metamaskbot Sep 11, 2024
bc302c5
Empty
sahar-fehri Sep 11, 2024
b658d4f
fix: refactor
sahar-fehri Sep 11, 2024
1103eb4
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 11, 2024
3a30a15
fix: fix
sahar-fehri Sep 12, 2024
f809cb8
fix: fix
sahar-fehri Sep 12, 2024
a901ac3
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 12, 2024
6d0a2bf
fix: merge conflicts
sahar-fehri Sep 16, 2024
0df17e5
fix: merge conflicts
sahar-fehri Sep 16, 2024
a832454
Update LavaMoat policies
metamaskbot Sep 17, 2024
e92a159
fix: fix merge conflicts
sahar-fehri Sep 17, 2024
96b56f4
fix: rm not needed nftController callbacks
sahar-fehri Sep 17, 2024
4b7eeb6
fix: merge conflicts
sahar-fehri Sep 18, 2024
82b3271
Merge branch 'develop' into feat/upgrade-assets-controllers-to-v37
sahar-fehri Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,28 +587,24 @@ export default class MetamaskController extends EventEmitter {
state: initState.TokenListController,
});

this.assetsContractController = new AssetsContractController(
{
chainId: getCurrentChainId({ metamask: this.networkController.state }),
onPreferencesStateChange: (listener) =>
this.preferencesController.store.subscribe(listener),
onNetworkDidChange: (cb) =>
networkControllerMessenger.subscribe(
'NetworkController:networkDidChange',
() => {
const networkState = this.networkController.state;
return cb(networkState);
},
),
getNetworkClientById: this.networkController.getNetworkClientById.bind(
this.networkController,
),
},
{
provider: this.provider,
},
initState.AssetsContractController,
);
const assetsContractControllerMessenger =
this.controllerMessenger.getRestricted({
name: 'AssetsContractController',
allowedActions: [
'NetworkController:getNetworkClientById',
'NetworkController:getNetworkConfigurationByNetworkClientId',
'NetworkController:getSelectedNetworkClient',
'NetworkController:getState',
],
allowedEvents: [
'PreferencesController:stateChange',
'NetworkController:networkDidChange',
],
});
this.assetsContractController = new AssetsContractController({
messenger: assetsContractControllerMessenger,
chainId: getCurrentChainId({ metamask: this.networkController.state }),
});

const tokensControllerMessenger = this.controllerMessenger.getRestricted({
name: 'TokensController',
Expand Down Expand Up @@ -644,6 +640,12 @@ export default class MetamaskController extends EventEmitter {
`${this.networkController.name}:getNetworkClientById`,
'AccountsController:getSelectedAccount',
'AccountsController:getAccount',
'AssetsContractController:getERC721AssetName',
'AssetsContractController:getERC721AssetSymbol',
'AssetsContractController:getERC721TokenURI',
'AssetsContractController:getERC721OwnerOf',
'AssetsContractController:getERC1155BalanceOf',
'AssetsContractController:getERC1155TokenURI',
],
});
this.nftController = new NftController({
Expand Down
20 changes: 10 additions & 10 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/assets-controllers>multiformats": true
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true
}
},
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@ensdomains/content-hash>multihashes": {
Expand Down Expand Up @@ -830,14 +838,14 @@
"setTimeout": true
},
"packages": {
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@ethersproject/abi>@ethersproject/address": true,
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/assets-controllers>cockatiel": true,
"@metamask/assets-controllers>multiformats": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
Expand Down Expand Up @@ -877,14 +885,6 @@
"process": true
}
},
"@metamask/assets-controllers>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@metamask/base-controller": {
"globals": {
"setTimeout": true
Expand Down
20 changes: 10 additions & 10 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/assets-controllers>multiformats": true
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true
}
},
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@ensdomains/content-hash>multihashes": {
Expand Down Expand Up @@ -830,14 +838,14 @@
"setTimeout": true
},
"packages": {
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@ethersproject/abi>@ethersproject/address": true,
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/assets-controllers>cockatiel": true,
"@metamask/assets-controllers>multiformats": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
Expand Down Expand Up @@ -877,14 +885,6 @@
"process": true
}
},
"@metamask/assets-controllers>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@metamask/base-controller": {
"globals": {
"setTimeout": true
Expand Down
20 changes: 10 additions & 10 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/assets-controllers>multiformats": true
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true
}
},
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@ensdomains/content-hash>multihashes": {
Expand Down Expand Up @@ -830,14 +838,14 @@
"setTimeout": true
},
"packages": {
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@ethersproject/abi>@ethersproject/address": true,
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/assets-controllers>cockatiel": true,
"@metamask/assets-controllers>multiformats": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
Expand Down Expand Up @@ -877,14 +885,6 @@
"process": true
}
},
"@metamask/assets-controllers>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@metamask/base-controller": {
"globals": {
"setTimeout": true
Expand Down
20 changes: 10 additions & 10 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@
"TextEncoder": true
},
"packages": {
"@metamask/assets-controllers>multiformats": true
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true
}
},
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@ensdomains/content-hash>multihashes": {
Expand Down Expand Up @@ -922,14 +930,14 @@
"setTimeout": true
},
"packages": {
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@ethersproject/abi>@ethersproject/address": true,
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/assets-controllers>cockatiel": true,
"@metamask/assets-controllers>multiformats": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
Expand Down Expand Up @@ -969,14 +977,6 @@
"process": true
}
},
"@metamask/assets-controllers>multiformats": {
"globals": {
"TextDecoder": true,
"TextEncoder": true,
"console.warn": true,
"crypto.subtle.digest": true
}
},
"@metamask/base-controller": {
"globals": {
"setTimeout": true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
"@metamask/address-book-controller": "^5.0.0",
"@metamask/announcement-controller": "^7.0.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/assets-controllers": "^36.0.0",
"@metamask/assets-controllers": "^37.0.0",
"@metamask/base-controller": "^6.0.2",
"@metamask/bitcoin-wallet-snap": "^0.5.0",
"@metamask/browser-passworder": "^4.3.0",
Expand Down
Loading