Skip to content

cache balances by chain id#10545

Merged
brad-decker merged 1 commit intodevelopfrom
chain-id-fixes
Mar 2, 2021
Merged

cache balances by chain id#10545
brad-decker merged 1 commit intodevelopfrom
chain-id-fixes

Conversation

@brad-decker
Copy link
Copy Markdown
Contributor

progresses: #8668

  • cache balances by chain id
  • select balances by chain id
  • fall back to network id

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [32709b1]
Page Load Metrics (611 ± 34 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint49836194
domContentLoaded3737226107034
load3757236117034
domInteractive3737216097034

@brad-decker brad-decker marked this pull request as ready for review March 2, 2021 17:44
@brad-decker brad-decker requested a review from a team as a code owner March 2, 2021 17:44
@brad-decker brad-decker requested a review from Gudahtt March 2, 2021 17:44
export function getMetaMaskCachedBalances(state) {
const chainId = getCurrentChainId(state);

// Fallback to fetching cached balances from network id
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TIL that we persist our cached account balances. I was going to suggest that we could remove the fallback now, because they aren't persisted, but I checked and I was mistaken.

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@brad-decker brad-decker merged commit e42658b into develop Mar 2, 2021
@brad-decker brad-decker deleted the chain-id-fixes branch March 2, 2021 22:53
@github-actions github-actions bot locked and limited conversation to collaborators Mar 2, 2021
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.

3 participants