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

Show total balance in account selector #1468

Merged
merged 5 commits into from May 25, 2023
Merged

Show total balance in account selector #1468

merged 5 commits into from May 25, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented May 18, 2023

Fixes #1110

@lukaw3d lukaw3d requested review from buberdds and csillag May 18, 2023 15:26
@github-actions
Copy link

github-actions bot commented May 18, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 20 0 0.11s
✅ REPOSITORY checkov yes no 21.71s
✅ REPOSITORY git_diff yes no 0.0s
✅ TSX eslint 5 0 0 7.09s
✅ TYPESCRIPT eslint 13 0 0 9.07s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #1468 (67ffd82) into master (9bf9c78) will increase coverage by 0.00%.
The diff coverage is 84.61%.

❗ Current head 67ffd82 differs from pull request most recent head 4cb69d9. Consider uploading reports for the commit 4cb69d9 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1468   +/-   ##
=======================================
  Coverage   83.02%   83.02%           
=======================================
  Files         154      155    +1     
  Lines        4042     4048    +6     
  Branches      726      728    +2     
=======================================
+ Hits         3356     3361    +5     
- Misses        686      687    +1     
Flag Coverage Δ
cypress 51.12% <80.00%> (+0.01%) ⬆️
jest 78.12% <74.35%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ponents/Toolbar/Features/AccountSelector/index.tsx 100.00% <ø> (ø)
src/app/state/account/saga.ts 79.22% <50.00%> (-1.47%) ⬇️
src/app/lib/getAccountBalanceWithFallback.ts 90.00% <90.00%> (ø)
src/app/lib/helpers.ts 79.45% <100.00%> (ø)
...ge/Features/ImportAccountsSelectionModal/index.tsx 91.93% <100.00%> (+0.13%) ⬆️
src/app/state/importaccounts/saga.ts 92.92% <100.00%> (ø)
src/app/state/transaction/saga.ts 71.60% <100.00%> (+0.17%) ⬆️
src/app/state/wallet/saga.ts 96.05% <100.00%> (-0.25%) ⬇️

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 23, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cb69d9
Status:🚫  Build failed.

View logs

Copy link
Contributor

@csillag csillag left a comment

Choose a reason for hiding this comment

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

Reviewed, LGTM.

One question, though.

As far as I can tell, currently when the API call fails, and we fall back to the gRPC, this is all done silently. So just by looking at the UI, there is no way to tell whether we are seeing the real total balance, or just the portion returned by the gRPC fallback.

I don't like that. I would prefer somehow flagging the accounts where we couldn't get the full balance, and adding a visual indicator (maybe a question mark?) to the UI in this case.

(But this can be done in a separate PR)

available: grpcBalance.available,
delegations: null,
debonding: null,
total: null,
Copy link
Member Author

Choose a reason for hiding this comment

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

@csillag: As far as I can tell, currently when the API call fails, and we fall back to the gRPC, this is all done silently. So just by looking at the UI, there is no way to tell whether we are seeing the real total balance, or just the portion returned by the gRPC fallback.

This fallback returns null total, rather than available + 0 + 0 so the displayed balances shouldn't be misleading. But I noticed we don't differentiate loading and null. It just keeps loading
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed
image

@lukaw3d lukaw3d enabled auto-merge May 25, 2023 17:29
@lukaw3d lukaw3d merged commit e9bd265 into master May 25, 2023
8 of 9 checks passed
@lukaw3d lukaw3d deleted the lw/balance branch May 25, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show total balance from API in account selector
2 participants