Skip to content

Commit

Permalink
happy path test
Browse files Browse the repository at this point in the history
addresses review comment #457 (comment)
  • Loading branch information
feuGeneA committed Sep 5, 2024
1 parent db7c113 commit 23a4a41
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 11 deletions.
6 changes: 3 additions & 3 deletions peers/app_request_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ type ConnectedCanonicalValidators struct {
ConnectedWeight uint64
TotalValidatorWeight uint64
ValidatorSet []*warp.Validator
nodeValidatorIndexMap map[ids.NodeID]int
NodeValidatorIndexMap map[ids.NodeID]int
}

// Returns the Warp Validator and its index in the canonical Validator ordering for a given nodeID
func (c *ConnectedCanonicalValidators) GetValidator(nodeID ids.NodeID) (*warp.Validator, int) {
return c.ValidatorSet[c.nodeValidatorIndexMap[nodeID]], c.nodeValidatorIndexMap[nodeID]
return c.ValidatorSet[c.NodeValidatorIndexMap[nodeID]], c.NodeValidatorIndexMap[nodeID]
}

// ConnectToCanonicalValidators connects to the canonical validators of the given subnet and returns the connected
Expand Down Expand Up @@ -258,7 +258,7 @@ func (n *appRequestNetwork) ConnectToCanonicalValidators(subnetID ids.ID) (*Conn
ConnectedWeight: connectedWeight,
TotalValidatorWeight: totalValidatorWeight,
ValidatorSet: validatorSet,
nodeValidatorIndexMap: nodeValidatorIndexMap,
NodeValidatorIndexMap: nodeValidatorIndexMap,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions signature-aggregator/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package aggregator

import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"math/big"
Expand Down Expand Up @@ -554,6 +555,7 @@ func (s *SignatureAggregator) isValidSignatureResponse(
if !bls.Verify(pubKey, sig, unsignedMessage.Bytes()) {
s.logger.Debug(
"Failed verification for signature",
zap.String("pubKey", hex.EncodeToString(bls.PublicKeyToUncompressedBytes(pubKey))),
)
return blsSignatureBuf{}, false
}
Expand Down
Loading

0 comments on commit 23a4a41

Please sign in to comment.