Skip to content

Commit

Permalink
streamline quorum handling
Browse files Browse the repository at this point in the history
addresses review comments #393 (comment)
and #393 (comment)

i went ahead and just removed the `>=0` case (which, as discussed, should
really be `<=0`) since we're already checking `==0` in the previous branch, and
since it can't be `<0` since it's an unsigned value.
  • Loading branch information
feuGeneA committed Jul 30, 2024
1 parent e90f8d2 commit da09584
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions signature-aggregator/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,14 @@ func signatureAggregationAPIHandler(logger logging.Logger, aggregator *aggregato
writeJsonError(logger, w, msg)
return
}
var quorumNum uint64
if req.QuorumNum == 0 {
quorumNum := req.QuorumNum
if quorumNum == 0 {
quorumNum = defaultQuorumNum
} else if req.QuorumNum >= 0 || req.QuorumNum > 100 {
} else if req.QuorumNum > 100 {
msg := "Invalid quorum number"
logger.Warn(msg, zap.Uint64("quorum-num", req.QuorumNum))
writeJsonError(logger, w, msg)
return
} else {
quorumNum = req.QuorumNum
}
var signingSubnetID ids.ID
if req.SigningSubnetID != "" {
Expand Down

0 comments on commit da09584

Please sign in to comment.