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

chore(api): Add UTs for validators APIs #2519

Merged
merged 8 commits into from
Feb 18, 2025

Conversation

abi87
Copy link
Collaborator

@abi87 abi87 commented Feb 17, 2025

Added much needed unit tests around FilterValidators

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 46.15385% with 21 lines in your changes missing coverage. Please review.

Project coverage is 32.73%. Comparing base (99ed0c2) to head (41a6c4c).
Report is 3 commits behind head on node-api-validators.

Files with missing lines Patch % Lines
node-api/handlers/beacon/types/conversions.go 46.15% 14 Missing and 7 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           node-api-validators    #2519      +/-   ##
=======================================================
+ Coverage                32.04%   32.73%   +0.68%     
=======================================================
  Files                      351      351              
  Lines                    15801    15842      +41     
  Branches                    20       20              
=======================================================
+ Hits                      5064     5186     +122     
+ Misses                   10374    10272     -102     
- Partials                   363      384      +21     
Files with missing lines Coverage Δ
node-api/handlers/beacon/types/conversions.go 38.15% <46.15%> (+38.15%) ⬆️

... and 4 files with indirect coverage changes

@abi87 abi87 changed the title chore(api): Add UTs for validators APIa chore(api): Add UTs for validators APIs Feb 17, 2025
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 1524f0a to 50fc5fa Compare February 17, 2025 23:53
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 50fc5fa to 9c6c847 Compare February 17, 2025 23:54
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 9c6c847 to 020b9b7 Compare February 17, 2025 23:58
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 020b9b7 to 4fe2b10 Compare February 18, 2025 00:04
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 4fe2b10 to e5cd7c2 Compare February 18, 2025 00:16
@abi87 abi87 force-pushed the node-api-validators-UTs branch from e5cd7c2 to 362c64b Compare February 18, 2025 00:41
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 362c64b to 67bd313 Compare February 18, 2025 00:47
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 67bd313 to d0cf104 Compare February 18, 2025 00:56
@abi87 abi87 force-pushed the node-api-validators-UTs branch from d0cf104 to 652a7b6 Compare February 18, 2025 00:57
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 652a7b6 to 86aa98c Compare February 18, 2025 01:00
Signed-off-by: aBear <abear@berachain.com>
@abi87 abi87 force-pushed the node-api-validators-UTs branch from 447182e to 81e3de2 Compare February 18, 2025 01:17
@abi87 abi87 marked this pull request as ready for review February 18, 2025 01:18
@abi87 abi87 requested a review from a team as a code owner February 18, 2025 01:18
@@ -73,3 +75,45 @@ func ValidatorFromConsensus(v *ctypes.Validator) *Validator {
WithdrawableEpoch: v.GetWithdrawableEpoch().Base10(),
}
}

// useful in UTs
func ValidatorToConsensus(v *Validator) (*ctypes.Validator, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: add property tests to ensure ValidatorToConsensus and ValidatorFromConsensus are dual

@abi87 abi87 merged commit 4d66219 into node-api-validators Feb 18, 2025
16 checks passed
@abi87 abi87 deleted the node-api-validators-UTs branch February 18, 2025 09:58
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.

1 participant