-
Notifications
You must be signed in to change notification settings - Fork 5k
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: upgrade assets controllers to version 44 #28472
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
f024224
upgrade
bergeron cfb46d1
remove unit test
bergeron 2f36b23
Merge branch 'develop' into brian/upgrade-assets-controllers-43
bergeron 25f5ed0
Update LavaMoat policies
metamaskbot 6c216f8
yarn dedupe
bergeron 2822c58
add unit test
bergeron 3d5323a
Update LavaMoat policies
metamaskbot ae198fb
lint
bergeron e1f3843
Merge branch 'brian/upgrade-assets-controllers-43' of github.com:Meta…
bergeron b090b3c
lint and fix test
bergeron 38fc254
onboarding
bergeron 6338a00
fix race condition
bergeron 6b22521
temporarily disable token detection polling
bergeron 5206a35
patch
bergeron 757d880
package json
bergeron abf8e11
fix unit test
bergeron c662098
update sentry state
bergeron 8f1cfb1
sentry state
bergeron 1411c2a
Merge branch 'develop' into brian/upgrade-assets-controllers-43
bergeron 05554a3
Merge branch 'develop' into brian/upgrade-assets-controllers-43
bergeron 729d07d
update patch
bergeron 21fcda3
dont poll when locked
bergeron 8b6391f
remove commented out code
bergeron b635ab8
fix e2e tests
bergeron ec38722
fix unit test
bergeron 8978d6d
upgrade assets controllers to 44
bergeron 79a451f
avoid calling hook different order
bergeron 979a3af
lint
bergeron 33d683f
Merge branch 'brian/upgrade-assets-controllers-43' into brian/upgrade…
bergeron dbaf0d1
lint
bergeron d399567
Merge branch 'develop' of github.com:MetaMask/metamask-extension into…
bergeron 9affc1f
fix unit test and lint
bergeron 63e01a0
fix unit test
bergeron 527962b
lint
bergeron 923af19
fix sentry state e2e tests
bergeron acacc07
fix unit test
bergeron 52cf1df
fix unit test
bergeron 5abcc71
fix unit tests
bergeron 2bf29f6
Merge branch 'develop' into brian/upgrade-assets-controllers-44
bergeron 5c55130
lint
bergeron 5ff384a
Merge branch 'brian/upgrade-assets-controllers-44' of github.com:Meta…
bergeron 9214479
lint
bergeron 9facc09
fix e2e test updating balance after send
bergeron 2e2a61d
undo file
bergeron 0f3ae99
undo confirmations changes
bergeron d5413f3
fix unit tests
bergeron 613a07a
remove empty line
bergeron 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
File renamed without changes.
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
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
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 |
---|---|---|
|
@@ -15,31 +15,21 @@ const mockTokenBalances = [ | |
balance: '48573', | ||
balanceError: null, | ||
decimals: 6, | ||
image: undefined, | ||
isERC721: undefined, | ||
string: '0.04857', | ||
string: 0.04857, | ||
symbol: 'USDC', | ||
tokenFiatAmount: '0.05', | ||
}, | ||
{ | ||
address: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', | ||
symbol: 'YFI', | ||
balance: '1409247882142934', | ||
decimals: 18, | ||
string: '0.001409247882142934', | ||
string: 0.00141, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
balanceError: null, | ||
tokenFiatAmount: '7.52', | ||
}, | ||
]; | ||
|
||
jest.mock('./useTokenTracker', () => { | ||
return { | ||
useTokenTracker: () => ({ | ||
loading: false, | ||
tokensWithBalances: mockTokenBalances, | ||
error: null, | ||
}), | ||
}; | ||
}); | ||
|
||
const mockAccount = createMockInternalAccount({ | ||
name: 'Account 1', | ||
address: '0x0836f5ed6b62baf60706fe3adc0ff0fd1df833da', | ||
|
@@ -104,7 +94,7 @@ const renderUseMultichainAccountTotalFiatBalance = ( | |
}, | ||
...mockNetworkState({ chainId: CHAIN_IDS.MAINNET }), | ||
|
||
detectedTokens: { | ||
allTokens: { | ||
'0x1': { | ||
'0x0836f5ed6b62baf60706fe3adc0ff0fd1df833da': [ | ||
{ | ||
|
@@ -122,6 +112,14 @@ const renderUseMultichainAccountTotalFiatBalance = ( | |
], | ||
}, | ||
}, | ||
tokenBalances: { | ||
[mockAccount.address]: { | ||
[CHAIN_IDS.MAINNET]: { | ||
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': '0xBDBD', | ||
'0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e': '0x501B4176A64D6', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
|
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.
We don't have an easy way to replicate the loading flag. Both because the token balances controller doesn't currently set any state indicating an update is in progress. And because in the multichain world, it may not be a single request we're waiting on. Each network will update and return separately. We don't have UI to indicate that specific balances are loading.
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.
Reading balances from state will have some UI benefits though. Since we don't have to wait for requests to return, we can always immediately show what we have in state, without an initial 'loading' flash. The values may be stale though, so in the future we may want to indicate which balances are very stale. Perhaps the controller could timestamp in state the time of the last update for each balance.