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

Cache token balances #35986

Closed
StephenHeaps opened this issue Feb 10, 2023 · 1 comment · Fixed by brave/brave-core#22029
Closed

Cache token balances #35986

StephenHeaps opened this issue Feb 10, 2023 · 1 comment · Fixed by brave/brave-core#22029
Assignees
Labels
feature/web3/wallet Integrating Ethereum+ wallet support front-end-change This task is a front end task and doesn't need any C++ changes OS/iOS Fixes related to iOS browser functionality QA Pass - iPhone X QA/Yes release-notes/include

Comments

@StephenHeaps
Copy link

StephenHeaps commented Feb 10, 2023

Description:

We should cache token balances for each account in Core Data so user doesn't have to wait for full balances fetch for all assets to load

https://bravesoftware.slack.com/archives/C023VS4HJ6Q/p1676011945567489

In summary, balances in Portfolio (Assets) will be refreshed when

  1. A wallet is created
  2. A wallet is restored
  3. When wallet is unlocked
  4. A account is created or added
  5. A network is added
  6. An asset is added
  7. An asset's visibility status is changed to be visible
  8. A transaction is confirmed or error out or dropped
@nuo-xu nuo-xu transferred this issue from brave/brave-ios Feb 12, 2024
@nuo-xu nuo-xu self-assigned this Feb 12, 2024
@nuo-xu nuo-xu added feature/web3/wallet Integrating Ethereum+ wallet support QA/Yes OS/iOS Fixes related to iOS browser functionality front-end-change This task is a front end task and doesn't need any C++ changes labels Feb 12, 2024
@brave-builds brave-builds added this to the 1.64.x - Nightly milestone Feb 14, 2024
@srirambv
Copy link
Contributor

Verification passed on iPhone 13 with iOS 17.4 running 1.64 (109)

  • Verified steps from brave/brave-core#22029
  • Verified on a clean wallet loads all tokens with 0 balance
  • Verified closing wallet and reopening wallet without locking doesn't do a balance refetch
  • Verified restoring wallet on a clean install loads wallet balance
  • Verified closing wallet and reopening wallet without locking doesn't do a balance refetch
  • Verified auto-discovery of NFT works as expected
  • Verified adding a token with balance to visible asset automatically updates balance
  • Verified adding/removing token from visible list updates balance
  • Verified adding/removing custom network updates portfolio balance
  • Verified submitting a transaction updates the token and portfolio balance
  • Verified upgrading from older version with balance, there is no balance refetch everytime wallet is opened (dismiss without locking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/web3/wallet Integrating Ethereum+ wallet support front-end-change This task is a front end task and doesn't need any C++ changes OS/iOS Fixes related to iOS browser functionality QA Pass - iPhone X QA/Yes release-notes/include
Projects
Archived in project
5 participants