-
Notifications
You must be signed in to change notification settings - Fork 324
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
[staking] fix readStateCandidates returning empty #3882
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3882 +/- ##
==========================================
+ Coverage 75.38% 75.48% +0.10%
==========================================
Files 303 325 +22
Lines 25923 27585 +1662
==========================================
+ Hits 19541 20823 +1282
- Misses 5360 5692 +332
- Partials 1022 1070 +48
... and 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -188,7 +188,7 @@ func (c *compositeStakingStateReader) readStateCandidates(ctx context.Context, r | |||
) | |||
if epochStartHeight != 0 && c.nativeIndexer != nil { | |||
// read candidates from indexer | |||
candidatesBytes, height, err = c.nativeIndexer.GetCandidates(height, req.GetPagination().GetOffset(), req.GetPagination().GetLimit()) | |||
candidatesBytes, height, err = c.nativeIndexer.GetCandidates(epochStartHeight, req.GetPagination().GetOffset(), req.GetPagination().GetLimit()) |
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.
change nativeIndexer.GetCandidates
to directly return CandidateList
, this can save a Marshal
and Unmarshal
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.
in candidate_buckets_indexer.go
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
fix two bugs on
readStateCandidates
:Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: