diff --git a/utils/crypto/bls/blstest/public_test.go b/utils/crypto/bls/public_test.go similarity index 65% rename from utils/crypto/bls/blstest/public_test.go rename to utils/crypto/bls/public_test.go index 3f21bbbfb543..5778e236f5b8 100644 --- a/utils/crypto/bls/blstest/public_test.go +++ b/utils/crypto/bls/public_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package blstest +package bls import ( "encoding/base64" @@ -10,15 +10,14 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/utils" - "github.com/ava-labs/avalanchego/utils/crypto/bls" ) func TestPublicKeyFromCompressedBytesWrongSize(t *testing.T) { require := require.New(t) - pkBytes := utils.RandomBytes(bls.PublicKeyLen + 1) - _, err := bls.PublicKeyFromCompressedBytes(pkBytes) - require.ErrorIs(err, bls.ErrFailedPublicKeyDecompress) + pkBytes := utils.RandomBytes(PublicKeyLen + 1) + _, err := PublicKeyFromCompressedBytes(pkBytes) + require.ErrorIs(err, ErrFailedPublicKeyDecompress) } func TestPublicKeyBytes(t *testing.T) { @@ -27,10 +26,10 @@ func TestPublicKeyBytes(t *testing.T) { pkBytes, err := base64.StdEncoding.DecodeString("h5qt9SPxaCo+vOx6sn+QkkpP7Y40Yja7SEAs2MGb/mZT7oKTWgLogjy5c4/wWIGC") require.NoError(err) - pk, err := bls.PublicKeyFromCompressedBytes(pkBytes) + pk, err := PublicKeyFromCompressedBytes(pkBytes) require.NoError(err) - pk2Bytes := bls.PublicKeyToCompressedBytes(pk) + pk2Bytes := PublicKeyToCompressedBytes(pk) require.Equal(pkBytes, pk2Bytes) } @@ -41,13 +40,13 @@ func TestAggregatePublicKeysNoop(t *testing.T) { pkBytes, err := base64.StdEncoding.DecodeString("h5qt9SPxaCo+vOx6sn+QkkpP7Y40Yja7SEAs2MGb/mZT7oKTWgLogjy5c4/wWIGC") require.NoError(err) - pk, err := bls.PublicKeyFromCompressedBytes(pkBytes) + pk, err := PublicKeyFromCompressedBytes(pkBytes) require.NoError(err) - aggPK, err := bls.AggregatePublicKeys([]*bls.PublicKey{pk}) + aggPK, err := AggregatePublicKeys([]*PublicKey{pk}) require.NoError(err) - aggPKBytes := bls.PublicKeyToCompressedBytes(aggPK) + aggPKBytes := PublicKeyToCompressedBytes(aggPK) require.NoError(err) require.Equal(pk, aggPK)