-
Notifications
You must be signed in to change notification settings - Fork 920
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
Add configurable deposit amounts to testutil #7775
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7775 +/- ##
==========================================
+ Coverage 62.17% 62.21% +0.03%
==========================================
Files 429 429
Lines 30340 30340
==========================================
+ Hits 18863 18875 +12
+ Misses 8541 8530 -11
+ Partials 2936 2935 -1 |
shared/testutil/deposits_test.go
Outdated
"github.com/gogo/protobuf/proto" | ||
|
||
"github.com/prysmaticlabs/prysm/shared/params" | ||
|
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.
} | ||
sigRoot, err := (&pb.SigningData{ObjectRoot: root[:], Domain: domain}).HashTreeRoot() | ||
balance := params.BeaconConfig().MaxEffectiveBalance | ||
deposit, err := signedDeposit(secretKeys[i], publicKeys[i].Marshal(), publicKeys[i+1].Marshal(), balance) |
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.
any check here that i+1 wont exceed the list size?
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.
Not required, above we generate it with a +1 as well.
if len(balances) == int(numDeposits) { | ||
balance = balances[i] | ||
} | ||
deposit, err := signedDeposit(secretKeys[i], publicKeys[i].Marshal(), publicKeys[i+1].Marshal(), balance) |
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.
+1
What type of PR is this?
Test helper additions
What does this PR do? Why is it needed?
This PR adds extra deposit helpers to allow creating deterministic deposits with custom balances. It uses any available cache of secret keys and generates any if it needs.
This is in preparation for testing partial deposits in E2E.