iotex-core
iotex-core copied to clipboard
[staking] Replace ContainsSelfStakingBucket with isSelfStakeBucket
Description
Due to the introduction of endorsement, the SelfStakeBucketIndex field of the Candidate will not be reset between expiration and the next bucket action. Therefore, the ContainsSelfStakingBucket function returns true no longer to indicate whether the bucket is a valid self-stake bucket. As a result, this PR introduces a new private function isSelfStakeBucket to achieve this functionality.
Type of change
Please delete options that are not relevant.
- [x] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
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
- [] make test
- [] fullsync
- [] Other test (please specify)
Test Configuration:
- Firmware version:
- Hardware:
- Toolchain:
- SDK:
Checklist:
- [] My code follows the style guidelines of this project
- [] I have performed a self-review of my code
- [] I have commented my code, particularly in hard-to-understand areas
- [] I have made corresponding changes to the documentation
- [] My changes generate no new warnings
- [] I have added tests that prove my fix is effective or that my feature works
- [] New and existing unit tests pass locally with my changes
- [] Any dependent changes have been merged and published in downstream modules
Codecov Report
Attention: Patch coverage is 65.71429% with 24 lines in your changes are missing coverage. Please review.
Project coverage is 76.37%. Comparing base (
e1f0636) to head (ce73bda). Report is 181 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #4139 +/- ##
==========================================
+ Coverage 75.38% 76.37% +0.99%
==========================================
Files 303 339 +36
Lines 25923 28936 +3013
==========================================
+ Hits 19541 22101 +2560
- Misses 5360 5729 +369
- Partials 1022 1106 +84
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
