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

Bump controllers v30.0.2 #14906

Merged
merged 15 commits into from
Jul 18, 2022
Merged

Bump controllers v30.0.2 #14906

merged 15 commits into from
Jul 18, 2022

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Jun 9, 2022

Fixes: #14891

Updates @metamask/controllers to v30.0.2 and adapts to all of the breaking changes introduced in the latest major version bump (v30.0.0)

Most changes that this new controllers version introduces are related to Token Detection V2 & NFT support.

I left comments within the changes to explain most non-obvious changes, but there may still be some unexplained (and non-obvious) changes, so please don't hesitate to ask.

Key flows to test:

  1. NFTs (set env variables COLLECTIBLES_V1=1 in .metamaskrc
    a. Adding manually
    b. Adding via auto-detection
    c. Transferring
    d. Approving (approve() and setApprovalForAll())
  2. Hiding ERC20 Tokens

Let me know if you have any questions about how to test any of the flows described above!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

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.

@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch from ed7a2fc to 2d659e6 Compare June 9, 2022 20:59
@adonesky1 adonesky1 dismissed a stale review via e274d42 June 13, 2022 21:04
@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch from 3b5e02a to e274d42 Compare June 13, 2022 21:04
@adonesky1 adonesky1 dismissed a stale review via c7ecce2 June 14, 2022 17:20
@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch 8 times, most recently from 1679466 to 24336a7 Compare June 15, 2022 21:41
@adonesky1 adonesky1 dismissed a stale review via a1c6c93 June 16, 2022 15:50
@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch from a1c6c93 to b8d4ca8 Compare June 16, 2022 16:54
@metamaskbot
Copy link
Collaborator

Builds ready [0e7ad24]
Page Load Metrics (1749 ± 65 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint91152108168
domContentLoaded15822124173311254
load15832244174913665
domInteractive15822124173311254

highlights:

storybook

@NiranjanaBinoy NiranjanaBinoy dismissed a stale review via eb8f0bf June 17, 2022 20:34
@metamaskbot
Copy link
Collaborator

Builds ready [eb8f0bf]
Page Load Metrics (1680 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint782781104723
domContentLoaded1559175616595928
load1559187116807436
domInteractive1559175616595928

highlights:

storybook

@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch 2 times, most recently from a23c102 to 8f5914e Compare June 20, 2022 18:57
@adonesky1 adonesky1 changed the title Bump controllers v30.0.0 Bump controllers v30.0.2 Jun 20, 2022
@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch 5 times, most recently from 5483e03 to b806bbc Compare June 21, 2022 17:23
Comment on lines 298 to 313
onCollectibleAdded: ({ address, symbol, tokenId, standard, source }) =>
this.metaMetricsController.trackEvent({
token_contract_address: address,
token_symbol: symbol,
tokenId,
asset_type: ASSET_TYPES.COLLECTIBLE,
token_standard: standard,
source,
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

listener method added to CollectiblesController options object here

Comment on lines -439 to -463
useStaticTokenList: !this.preferencesController.store.getState()
.useTokenDetection,
onNetworkStateChange: (cb) =>
this.networkController.store.subscribe((networkState) => {
const modifiedNetworkState = {
...networkState,
provider: {
...networkState.provider,
chainId: hexToDecimal(networkState.provider.chainId),
},
};
return cb(modifiedNetworkState);
}),
onPreferencesStateChange: (cb) =>
this.preferencesController.store.subscribe((preferencesState) => {
const modifiedPreferencesState = {
...preferencesState,
useStaticTokenList: !this.preferencesController.store.getState()
.useTokenDetection,
};
return cb(modifiedPreferencesState);
}),
messenger: tokenListMessenger,
state: initState.TokenListController,
}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

useStaticTokenList and onPreferencesStateChange removed from TokenListController options object here

@@ -1585,7 +1561,6 @@ export default class MetamaskController extends EventEmitter {
tokensController,
),
updateTokenType: tokensController.updateTokenType.bind(tokensController),
removeToken: tokensController.removeAndIgnoreToken.bind(tokensController),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removeAndIgnoreToken method removed from TokensController here

@adonesky1 adonesky1 force-pushed the bump-controllers-v30.0.0 branch 3 times, most recently from 7a1a809 to 975d2d6 Compare July 15, 2022 20:59
@adonesky1 adonesky1 requested a review from darkwing July 15, 2022 22:12
@metamaskbot
Copy link
Collaborator

Builds ready [975d2d6]
Page Load Metrics (1666 ± 34 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint872591083718
domContentLoaded1522180016565928
load1522180016667134
domInteractive1522180016565928

highlights:

storybook

brad-decker
brad-decker previously approved these changes Jul 18, 2022
@adonesky1 adonesky1 merged commit 09164dc into develop Jul 18, 2022
@adonesky1 adonesky1 deleted the bump-controllers-v30.0.0 branch July 18, 2022 14:43
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2022
@metamaskbot
Copy link
Collaborator

Builds ready [1d4dffa]
Page Load Metrics (1800 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint822561174019
domContentLoaded15762194178919895
load157622461800211101
domInteractive15762194178919895

highlights:

storybook

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump @metamask/controllers to v30.0.0 and absorb breaking changes
8 participants