-
Notifications
You must be signed in to change notification settings - Fork 80
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
tbls: revert changes to TSS struct #149
Conversation
Threshold int | ||
// Threshold returns the minimum number of partial signatures required to aggregate the threshold signature. | ||
func (t TSS) Threshold() int { | ||
return len(t.verifier.Commitments) | ||
} | ||
|
||
func NewTSS(verifier *share.FeldmanVerifier, numShares int) (TSS, error) { |
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.
I think it is good to still calculate the public key on construction:
- Then we fail fast if we cannot calculate it, instead of later.
- Reduces error handling in general.
Codecov Report
@@ Coverage Diff @@
## main #149 +/- ##
=======================================
Coverage ? 54.55%
=======================================
Files ? 30
Lines ? 1976
Branches ? 0
=======================================
Hits ? 1078
Misses ? 792
Partials ? 106 Continue to review full report at Codecov.
|
type TSS struct { | ||
Verifier *share.FeldmanVerifier | ||
NumShares int | ||
verifier *share.FeldmanVerifier | ||
numShares int | ||
|
||
// PublicKey and Threshold are inferred from verifier commitments in NewTSS. | ||
// publicKey inferred from verifier commitments in NewTSS. | ||
publicKey *bls_sig.PublicKey | ||
} |
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.
refactoring to private fields, with getter methods. To make it explicit that you should use NewTSS
for constructing.
Adds unit tests to the scheduler package. Also adds some helper test utils: - app/golden: for golden file testing - beaconmock: beacon client mock category: testing ticket: #145
Reverts #136 by decoupling the dependency on TSS struct from scheduler, rather provide public keys directly.
category: refactor
ticket: #145