-
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
feat: upgrade assets controllers to version 44 #28472
Conversation
…Mask/metamask-extension into brian/upgrade-assets-controllers-43
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. |
…Mask/metamask-extension into brian/upgrade-assets-controllers-44
}, | ||
{ | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -54,10 +54,11 @@ export const useAccountTotalFiatBalance = ( | |||
const primaryTokenImage = useSelector(getNativeCurrencyImage); | |||
const nativeCurrency = useSelector(getNativeCurrency); | |||
|
|||
const { loading, tokensWithBalances } = useTokenTracker({ | |||
const loading = false; |
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.
Builds ready [613a07a]
Page Load Metrics (2019 ± 57 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Upgrades the assets controllers to version 44. And starts replacing some instances of https://github.com/MetaMask/eth-token-tracker with reading state from the
TokenBalancesController
Related issues
Manual testing steps
No visual changes. Token balances should render correctly like before on the tokens page, and when switching accounts and chains.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist