Conversation
|
AnomalRoil
left a comment
There was a problem hiding this comment.
Nice cleanup, just a few comments.
| func (d *DistKeyGenerator) Deals() (*DealBundle, error) { | ||
| if !d.canIssue { | ||
| return nil, fmt.Errorf("new members can't issue deals") | ||
| return nil, errors.New("new members can't issue deals") |
There was a problem hiding this comment.
Ideally this should be an exported NamedError so people can match against it.
| if !d.canReceive && d.state != DealPhase { | ||
| // if we are a old node that will leave | ||
| return nil, nil, fmt.Errorf("leaving node can process responses only after creating shares") | ||
| return nil, nil, errors.New("leaving node can process responses only after creating shares") |
There was a problem hiding this comment.
Ideally this should be an exported NamedError so people can match against it.
| return nil, nil, fmt.Errorf("leaving node can process responses only after creating shares") | ||
| return nil, nil, errors.New("leaving node can process responses only after creating shares") | ||
| } else if d.state != ResponsePhase { | ||
| return nil, nil, fmt.Errorf("can only process responses after processing shares - current state %s", d.state) |
There was a problem hiding this comment.
The first part here could be a NamedError, and the fmt.Errorf could wrap it using %w - current state: %s
| "go.dedis.ch/kyber/v4/sign/bls" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| "go.dedis.ch/kyber/v4" | ||
| "go.dedis.ch/kyber/v4/pairing/bls12381/kilic" |
There was a problem hiding this comment.
these don't look optimally grouped, maybe the linter needs some extra settings to add a local group before the external deps?
| scalarCanonical, ok := group.Scalar().(scalarCanCheckCanonical) | ||
| if !ok { | ||
| return fmt.Errorf("could not cast group scalar to canonical") | ||
| return errors.New("could not cast group scalar to canonical") | ||
| } |
There was a problem hiding this comment.
this look like something that should be implemented as a compile time check rather than a type cast here by declaring a global variable like:
var _ scalarCanCheckCanonical = group.Scalar()
just after the declaration of group
There was a problem hiding this comment.
it's funny we're using exported errors for eddsa but not for schnorr.


No description provided.