-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ETH2 APIs: Implement Validator Status support #8940
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #8940 +/- ##
===========================================
+ Coverage 60.88% 60.92% +0.04%
===========================================
Files 529 529
Lines 37368 37418 +50
===========================================
+ Hits 22750 22798 +48
+ Misses 11358 11353 -5
- Partials 3260 3267 +7 |
} | ||
} | ||
|
||
return 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.
0
is ValidatorStatus_PENDING_INITIALIZED
, which is an incorrect value to return. We should return an error instead.
Status: []ethpb.ValidatorStatus{ethpb.ValidatorStatus_PENDING_INITIALIZED, ethpb.ValidatorStatus_EXITED_UNSLASHED}, | ||
}) | ||
require.NoError(t, err) | ||
assert.Equal(t, 4 /* 4 exited */, len(resp.Data)) |
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.
I think the comment is incorrect.
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.
Its correct, at the epoch there are 4 validators that fir the exit status criteria.
validator *ethpb.Validator | ||
epoch types.Epoch | ||
} | ||
tests := []struct { |
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.
You forgot about pending_queued
validator *ethpb.Validator | ||
epoch types.Epoch | ||
} | ||
tests := []struct { |
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.
You forgot about pending_queued
case ethpb.ValidatorStatus_WITHDRAWAL_POSSIBLE, ethpb.ValidatorStatus_WITHDRAWAL_DONE: | ||
return ethpb.ValidatorStatus_WITHDRAWAL | ||
} | ||
return 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.
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR fixes #8901 and is part of #7510. This PR adds validator status enum support to your API, allowing the api to return validators status, and allowing filtering the validator set based on their status.