-
Notifications
You must be signed in to change notification settings - Fork 8
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 check of rosterLen before sending dkg request #223
add check of rosterLen before sending dkg request #223
Conversation
Pull Request Test Coverage Report for Build 3535095716Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
67577d2
to
06d20e9
Compare
Kudos, SonarCloud Quality Gate passed! |
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.
Nice small optimization :)
if players.Len() == 0 { | ||
return xerrors.Errorf("the list of Participants is empty") | ||
} |
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.
should we call a.setErr here ?
This function is called when we want to decrypt the ballots, so I am wondering what we would be able to do / should do in the scenario where players is empty...
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.
yes, true.
@Flamewind97 please add a setErr
as in other cases.
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.
In the end we don't need, I mixed the context.
if players.Len() == 0 { | ||
return xerrors.Errorf("the list of Participants is empty") | ||
} |
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.
yes, true.
@Flamewind97 please add a setErr
as in other cases.
if players.Len() == 0 { | ||
return xerrors.Errorf("the list of Participants is empty") | ||
} |
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.
In the end we don't need, I mixed the context.
Before defines every addrs array in services, we check the rosterLen is not empty to have an early return