Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Kim <[email protected]>
  • Loading branch information
joshua-kim committed Oct 22, 2024
1 parent 67da634 commit 60761f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion network/p2p/acp118/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import (
)

var (
ErrDuplicateValidator = errors.New("duplicate validator")
ErrDuplicateValidator = errors.New("duplicate validator")
// ErrInsufficientSignatures is returned if it's not possible for us to
// generate a signature due to too many unsuccessful requests to peers
ErrInsufficientSignatures = errors.New("failed to aggregate sufficient stake weight of signatures")
)

Expand Down
14 changes: 6 additions & 8 deletions network/p2p/acp118/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ package acp118

import (
"context"
"errors"
"testing"

"github.com/stretchr/testify/require"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/network/p2p"
"github.com/ava-labs/avalanchego/network/p2p/p2ptest"
"github.com/ava-labs/avalanchego/snow/engine/common"
"github.com/ava-labs/avalanchego/snow/validators"
"github.com/ava-labs/avalanchego/snow/validators/validatorstest"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
Expand Down Expand Up @@ -54,8 +54,8 @@ func TestVerifier_Verify(t *testing.T) {
wantVerifyErr error
}{
{
name: "passes attestation and verification",
handler: NewHandler(&testAttestor{}, signer, networkID, chainID),
name: "pass - gets signatures from sufficient stake",
handler: NewHandler(&testVerifier{}, signer),
ctx: context.Background(),
validators: []Validator{
{
Expand Down Expand Up @@ -84,8 +84,8 @@ func TestVerifier_Verify(t *testing.T) {
quorumDen: 1,
},
{
name: "passes attestation and fails verification - insufficient stake",
handler: NewHandler(&testAttestor{}, signer, networkID, chainID),
name: "fail - gets signatures from insufficient stake",
handler: NewHandler(&testVerifier{}, signer),
ctx: context.Background(),
validators: []Validator{
{
Expand Down Expand Up @@ -122,10 +122,8 @@ func TestVerifier_Verify(t *testing.T) {
{
name: "fails attestation",
handler: NewHandler(
&testAttestor{Err: errors.New("foobar")},
&testVerifier{Errs: []*common.AppError{common.ErrUndefined}},
signer,
networkID,
chainID,
),
ctx: context.Background(),
validators: []Validator{
Expand Down

0 comments on commit 60761f8

Please sign in to comment.