Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vms/platformvm/warp/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (s *BitSetSignature) Verify(
quorumDen uint64,
) error {
if msg.NetworkID != networkID {
return errWrongNetworkID
return ErrWrongNetworkID
}

subnetID, err := pChainState.GetSubnetID(ctx, msg.SourceChainID)
Expand Down
2 changes: 1 addition & 1 deletion vms/platformvm/warp/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func TestSignatureVerification(t *testing.T) {
require.NoError(err)
return msg
},
err: errWrongNetworkID,
err: ErrWrongNetworkID,
},
}

Expand Down
8 changes: 4 additions & 4 deletions vms/platformvm/warp/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
var (
_ Signer = (*signer)(nil)

errWrongSourceChainID = errors.New("wrong SourceChainID")
errWrongNetworkID = errors.New("wrong networkID")
ErrWrongSourceChainID = errors.New("wrong SourceChainID")
ErrWrongNetworkID = errors.New("wrong networkID")
)

type Signer interface {
Expand Down Expand Up @@ -42,10 +42,10 @@ type signer struct {

func (s *signer) Sign(msg *UnsignedMessage) ([]byte, error) {
if msg.SourceChainID != s.chainID {
return nil, errWrongSourceChainID
return nil, ErrWrongSourceChainID
}
if msg.NetworkID != s.networkID {
return nil, errWrongNetworkID
return nil, ErrWrongNetworkID
}

msgBytes := msg.Bytes()
Expand Down
4 changes: 2 additions & 2 deletions vms/platformvm/warp/test_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestSignerWrongChainID(t *testing.T, s Signer, _ *bls.SecretKey, _ uint32,
require.NoError(err)

_, err = s.Sign(msg)
// TODO: require error to be errWrongSourceChainID
// TODO: require error to be ErrWrongSourceChainID
require.Error(err) //nolint:forbidigo // currently returns grpc errors too
}

Expand All @@ -47,7 +47,7 @@ func TestSignerWrongNetworkID(t *testing.T, s Signer, _ *bls.SecretKey, networkI
require.NoError(err)

_, err = s.Sign(msg)
// TODO: require error to be errWrongNetworkID
// TODO: require error to be ErrWrongNetworkID
require.Error(err) //nolint:forbidigo // currently returns grpc errors too
}

Expand Down