mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
31 lines
864 B
Go
31 lines
864 B
Go
package bls
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/crypto/bls/common"
|
|
"github.com/prysmaticlabs/prysm/v5/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)
|
|
})
|
|
}
|