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

Don't use misleading balance fields from RPC #927

Merged
merged 5 commits into from
Jul 13, 2022
Merged

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Jul 13, 2022

Stop using misleading total field from parseRpcBalance, remove it, and group validator-specific fields. In the future we should convert some of these RPC calls to API calls and use correct total

Before available + escrow (validator) + escrow_debonding (validator) After available
before after

@lukaw3d lukaw3d requested review from buberdds and tjanez July 13, 2022 01:42
@lukaw3d lukaw3d changed the title Don't use wrong balance fields from RPC Don't use misleading balance fields from RPC Jul 13, 2022
@github-actions
Copy link

github-actions bot commented Jul 13, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 11 0 0.04s
✅ GIT git_diff yes no 0.02s
✅ TSX eslint 5 0 0 6.11s
✅ TYPESCRIPT eslint 5 0 0 5.57s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

<div
class="c10"
>
0.0000001
Copy link
Contributor

Choose a reason for hiding this comment

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

Where this balance is defined ?

Copy link
Member Author

Choose a reason for hiding this comment

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

balance: { available: '100', validator: { escrow: '5000', escrow_debonding: '300' } },

100 / 10**9

@lukaw3d lukaw3d force-pushed the lw/rpc-balances branch 2 times, most recently from 8330d65 to 5e0de43 Compare July 13, 2022 17:57
@lukaw3d
Copy link
Member Author

lukaw3d commented Jul 13, 2022

No idea why cypress CI runs forever on this PR 🤷

@lukaw3d
Copy link
Member Author

lukaw3d commented Jul 13, 2022

Pushing commit by commit 🤷

@lukaw3d
Copy link
Member Author

lukaw3d commented Jul 13, 2022

Update: something about grouping fields into validator: { creates infinite RPC requests after opening a wallet

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #927 (0b5dc4c) into master (a242c5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #927   +/-   ##
=======================================
  Coverage   87.58%   87.59%           
=======================================
  Files          97       97           
  Lines        1619     1620    +1     
  Branches      353      353           
=======================================
+ Hits         1418     1419    +1     
  Misses        201      201           
Flag Coverage Δ
cypress 57.85% <100.00%> (+0.02%) ⬆️
jest 74.21% <66.66%> (-0.11%) ⬇️

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% <ø> (ø)
...pages/OpenWalletPage/Features/FromLedger/index.tsx 68.42% <ø> (ø)
src/app/lib/helpers.ts 72.97% <100.00%> (-1.39%) ⬇️
src/app/pages/AccountPage/index.tsx 95.23% <100.00%> (+0.11%) ⬆️
src/app/state/wallet/selectors.ts 100.00% <100.00%> (ø)

@lukaw3d lukaw3d merged commit 0f24238 into master Jul 13, 2022
@lukaw3d lukaw3d deleted the lw/rpc-balances branch July 13, 2022 21:22
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.

None yet

2 participants