prysm-pulse/testing/bls/deserialization_G2_test.go
Raul Jordan d077483577
Add V3 Suffix to All Prysm Packages (#11083)
* v3 import renamings

* tidy

* fmt

* rev

* Update beacon-chain/core/epoch/precompute/reward_penalty_test.go

* Update beacon-chain/core/helpers/validators_test.go

* Update beacon-chain/db/alias.go

* Update beacon-chain/db/alias.go

* Update beacon-chain/db/alias.go

* Update beacon-chain/db/iface/BUILD.bazel

* Update beacon-chain/db/kv/kv.go

* Update beacon-chain/db/kv/state.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go

* Update beacon-chain/sync/initial-sync/service.go

* fix deps

* fix bad replacements

* fix bad replacements

* change back

* gohashtree version

* fix deps

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-08-16 12:20:13 +00:00

34 lines
812 B
Go

package bls
import (
"encoding/hex"
"testing"
"github.com/ghodss/yaml"
"github.com/prysmaticlabs/prysm/v3/crypto/bls"
"github.com/prysmaticlabs/prysm/v3/testing/bls/utils"
"github.com/prysmaticlabs/prysm/v3/testing/require"
)
func TestDeserializationG2(t *testing.T) {
t.Run("blst", testDeserializationG2)
}
func testDeserializationG2(t *testing.T) {
fNames, fContent := utils.RetrieveFiles("deserialization_G2", t)
for i, file := range fNames {
content := fContent[i]
t.Run(file, func(t *testing.T) {
test := &DeserializationG2Test{}
require.NoError(t, yaml.Unmarshal(content, test))
rawKey, err := hex.DecodeString(test.Input.Signature)
require.NoError(t, err)
_, err = bls.SignatureFromBytes(rawKey)
require.Equal(t, test.Output, err == nil)
t.Log("Success")
})
}
}