-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix: bump assets controller to 30.0.0 #24913
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
d089168
deps: @metamask/network-controller@^18.1.1->^18.1.2
legobeat dce3d43
fix(deps): @metamask/transaction-controller@^29.1.0->^30.0.0
legobeat fc950be
fix: force @metamask/transaction-controller to ^30.0.0
legobeat cda63c9
update lavamoat policies
legobeat c339ffd
fix: bump assets controller
salimtb 6c845db
fix nft controllers accessing `getNetworkClientById`
bergeron a5f795d
remove unused patches
bergeron dbab437
fix: fix getTokenExchangeRates selectors
salimtb c4ec3b2
fix: update yarn after rebase
salimtb c4ebdf0
fix unit tests
bergeron c8e6385
Update LavaMoat policies
metamaskbot f4a05df
add metamask.io domains to privacy snapshot
bergeron efa27ad
Merge branch 'bump-assets-controller-version' of github.com:MetaMask/…
bergeron 85c97fa
Merge branch 'develop' into bump-assets-controller-version
bergeron fe6df70
move more api endpoints to new metamask.io domain
bergeron c036089
Merge branch 'bump-assets-controller-version' of github.com:MetaMask/…
bergeron 5cb151c
fix e2e test
bergeron 52b931d
merge develop
bergeron 0807328
yarn
bergeron ae14fda
case insensitive symbol compare
bergeron 71ef082
fix: fix e2e tests
salimtb 005fabd
Merge branch 'bump-assets-controller-version' of github.com:MetaMask/…
bergeron 8546015
Merge branch 'develop' of github.com:MetaMask/metamask-extension into…
bergeron e1d50ff
yarn lavamoat:webapp:auto
bergeron fea8c66
Update LavaMoat policies
metamaskbot c57b688
Merge branch 'develop' into bump-assets-controller-version
salimtb 9ecb112
Merge branch 'develop' into bump-assets-controller-version
legobeat ce42d97
Merge branch 'develop' of github.com:MetaMask/metamask-extension into…
bergeron 6b4e655
add migration to remove deprecated fields
bergeron 2e80f49
patch https://github.com/MetaMask/core/pull/4361
bergeron 807e617
use `price` instead of `value`
bergeron fc06899
Merge branch 'develop' into bump-assets-controller-version
bergeron 0bb5711
empty
bergeron 05f6638
Merge branch 'bump-assets-controller-version' of github.com:MetaMask/…
bergeron dc6af6d
empty commit
bergeron babe108
.
bergeron 00b3917
Merge branch 'develop' into bump-assets-controller-version
bergeron 87dd240
Merge branch 'develop' into bump-assets-controller-version
salimtb 9fb556f
Merge branch 'develop' into bump-assets-controller-version
legobeat d40c703
Merge branch 'develop' into bump-assets-controller-version
salimtb 1ee4a84
Merge branch 'develop' into bump-assets-controller-version
salimtb 83a317d
fix: fix conflict with PR #24947
salimtb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
.yarn/patches/@metamask-assets-controllers-npm-26.0.0-17c0e9432c.patch
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
.yarn/patches/@metamask-assets-controllers-npm-30.0.0-8747c20871.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/dist/chunk-Z6TBQQE5.js b/dist/chunk-Z6TBQQE5.js | ||
index 2f1b66f2c39794d660553bbdc395697775f90e1d..18d7d5620d827419100c75736f6ec809161da212 100644 | ||
--- a/dist/chunk-Z6TBQQE5.js | ||
+++ b/dist/chunk-Z6TBQQE5.js | ||
@@ -295,7 +295,7 @@ var CodefiTokenPricesServiceV2 = class { | ||
(obj, tokenAddress) => { | ||
const lowercasedTokenAddress = tokenAddress.toLowerCase(); | ||
const marketData = addressCryptoDataMap[lowercasedTokenAddress]; | ||
- if (marketData === void 0) { | ||
+ if (!marketData) { | ||
return obj; | ||
} | ||
const { price } = marketData; |
40 changes: 0 additions & 40 deletions
40
.yarn/patches/@metamask-assets-controllers-patch-0f46262fea.patch
This file was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
.yarn/patches/@metamask-assets-controllers-patch-7616cc1669.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { migrate, version } from './120'; | ||
|
||
const oldVersion = 119; | ||
|
||
describe('migration #120', () => { | ||
afterEach(() => jest.resetAllMocks()); | ||
|
||
it('updates the version metadata', async () => { | ||
const oldStorage = { | ||
meta: { version: oldVersion }, | ||
data: {}, | ||
}; | ||
|
||
const newStorage = await migrate(oldStorage); | ||
expect(newStorage.meta).toStrictEqual({ version }); | ||
}); | ||
|
||
it('deletes the deprecated token rates controller fields', async () => { | ||
const oldStorage = { | ||
meta: { version: oldVersion }, | ||
data: { | ||
TokenRatesController: { | ||
contractExchangeRates: { | ||
'0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4': 0.00001142055192565137, | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': 1.000125, | ||
}, | ||
contractExchangeRatesByChainId: { | ||
'0x1': { | ||
ETH: { | ||
'0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4': 0.00001142055192565137, | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': 1.000125, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const newStorage = await migrate(oldStorage); | ||
expect(newStorage.data.TokenRatesController).toStrictEqual({}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { cloneDeep } from 'lodash'; | ||
import { hasProperty } from '@metamask/utils'; | ||
|
||
type VersionedData = { | ||
meta: { version: number }; | ||
data: Record<string, unknown>; | ||
}; | ||
|
||
export const version = 120; | ||
|
||
/** | ||
* This migration removes the deprecated fields `contractExchangeRates` | ||
* and `contractExchangeRatesByChainId` from the TokenRatesController. | ||
* | ||
* @param originalVersionedData - Versioned MetaMask extension state, exactly what we persist to dist. | ||
* @param originalVersionedData.meta - State metadata. | ||
* @param originalVersionedData.meta.version - The current state version. | ||
* @param originalVersionedData.data - The persisted MetaMask state, keyed by controller. | ||
* @returns Updated versioned MetaMask extension state. | ||
*/ | ||
export async function migrate( | ||
originalVersionedData: VersionedData, | ||
): Promise<VersionedData> { | ||
const versionedData = cloneDeep(originalVersionedData); | ||
versionedData.meta.version = version; | ||
transformState(versionedData.data); | ||
return versionedData; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function transformState(state: Record<string, any>) { | ||
if (hasProperty(state, 'TokenRatesController')) { | ||
delete state.TokenRatesController.contractExchangeRates; | ||
delete state.TokenRatesController.contractExchangeRatesByChainId; | ||
} | ||
return state; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget to follow-up ASAP after release of https://github.com/MetaMackask/metamask-extension/core/4364 so that patching won't be needed for this package