Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Validate lengths of arguments used in Validator module methods and endpoints #8920

Merged
merged 3 commits into from
Sep 1, 2023

Conversation

bobanm
Copy link
Contributor

@bobanm bobanm commented Sep 1, 2023

What was the problem?

This PR resolves #8914

How was it solved?

  • All relevant Validator methods now validate argument lengths using the new private method _validateLengths()
  • Updated validateBLSKey endpoint request schema to validate lengths of BLS key and proof of possession.
  • BONUS: improved tests to use constants for lengths instead of specifying number literals 😎

How was it tested?

  • Implemented additional tests for _validateLengths() method
  • All tests OK 👌🏻

@bobanm bobanm requested review from shuse2 and Incede September 1, 2023 00:51
@bobanm bobanm self-assigned this Sep 1, 2023
Copy link
Collaborator

@shuse2 shuse2 left a comment

Choose a reason for hiding this comment

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

change LGTM, the test/lint is failing

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #8920 (ae0cf98) into release/6.0.0 (108b1ce) will decrease coverage by 0.01%.
The diff coverage is 93.75%.

❗ Current head ae0cf98 differs from pull request most recent head b5809df. Consider uploading reports for the commit b5809df to get more accurate results

Impacted file tree graph

@@                Coverage Diff                @@
##           release/6.0.0    #8920      +/-   ##
=================================================
- Coverage          83.61%   83.61%   -0.01%     
=================================================
  Files                601      601              
  Lines              22520    22520              
  Branches            3323     3319       -4     
=================================================
- Hits               18830    18829       -1     
- Misses              3690     3691       +1     
Files Changed Coverage
framework/src/modules/validators/method.ts 93.33%
framework/src/modules/validators/schemas.ts 100.00%

@bobanm bobanm requested a review from shuse2 September 1, 2023 09:32
@shuse2 shuse2 enabled auto-merge (squash) September 1, 2023 10:55
@shuse2 shuse2 merged commit fbf48ba into release/6.0.0 Sep 1, 2023
8 checks passed
@shuse2 shuse2 deleted the 8914-validators-module-length-validation branch September 1, 2023 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants