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
Check stale validators with RPC #776
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #776 +/- ##
==========================================
- Coverage 88.52% 88.28% -0.25%
==========================================
Files 100 100
Lines 1664 1698 +34
Branches 332 339 +7
==========================================
+ Hits 1473 1499 +26
- Misses 191 199 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
src/app/state/staking/selectors.ts
Outdated
export const selectValidators = createSelector([selectStaking], state => state.validators?.list ?? []) | ||
export const selectValidatorsTimestamp = createSelector( | ||
[selectStaking], | ||
state => state.validators?.timestamp ?? 0, |
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.
When it can be undefined? Do we want to show 1970 in updateValidatorsError?
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.
1970 should never appear with current code. It is undefined until first maybeRefreshValidators
(initialState = { validators: null })
Annoying options:
- keep default 0, so type is number
- default to null, and force checking nullable everywhere we want to display timestamp. You have to check nullable even if we already check updateValidatorsError.
- create selector for
state.validators
, so that it is a single variable for nullable checks. But it probably isn't best practice, not minimal for mocking, and redux wouldn't detect changes if subfield changed.
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.
Hm, wait, 2. is fine if we just use non-null assertion
d73f69a
to
fa0cfad
Compare
fa0cfad
to
c745647
Compare
Resolves #751
Summary of new flow to fetch validators from comments: