prysm-pulse/crypto/bls/bls_test.go
terencechain d17996f8b0
Update to V4 🚀 (#12134)
* Update V3 from V4

* Fix build v3 -> v4

* Update ssz

* Update beacon_chain.pb.go

* Fix formatter import

* Update update-mockgen.sh comment to v4

* Fix conflicts. Pass build and tests

* Fix test
2023-03-17 18:52:56 +00:00

31 lines
864 B
Go

package bls
import (
"testing"
"github.com/prysmaticlabs/prysm/v4/crypto/bls/common"
"github.com/prysmaticlabs/prysm/v4/testing/require"
)
func TestDisallowZeroSecretKeys(t *testing.T) {
t.Run("blst", func(t *testing.T) {
// Blst does a zero check on the key during deserialization.
_, err := SecretKeyFromBytes(common.ZeroSecretKey[:])
require.Equal(t, common.ErrSecretUnmarshal, err)
})
}
func TestDisallowZeroPublicKeys(t *testing.T) {
t.Run("blst", func(t *testing.T) {
_, err := PublicKeyFromBytes(common.InfinitePublicKey[:])
require.Equal(t, common.ErrInfinitePubKey, err)
})
}
func TestDisallowZeroPublicKeys_AggregatePubkeys(t *testing.T) {
t.Run("blst", func(t *testing.T) {
_, err := AggregatePublicKeys([][]byte{common.InfinitePublicKey[:], common.InfinitePublicKey[:]})
require.Equal(t, common.ErrInfinitePubKey, err)
})
}