prysm-pulse/shared/bls/spectest/helper_test.go
Preston Van Loon 9bd6147027
BLS spec tests (#2826)
* bls spec tests

* add more bls tests

* use ioutil instead of bazel runfiles

* dont read bytes

* skip tests that overflow uint64

* manually fix input data

* add tests

* lint and gaz

* add all new changes

* some refactoring, cleanup, remove new API methods that only exist for tests

* gaz

* Remove yamls, skip test
2019-06-25 12:57:47 -04:00

22 lines
586 B
Go

package spectest
import (
"io/ioutil"
"github.com/bazelbuild/rules_go/go/tools/bazel"
)
const prefix = "/eth2_spec_tests/tests/bls/"
// Load BLS yaml from spec test bls directory. The file parameter should be in
// the format of the path starting at the bls directory.
// Example: aggregate_pubkeys/aggregate_pubkeys.yaml where the full path would
// be tests/bls/aggregate_pubkeys/aggregate_pubkeys.yaml.
func loadBlsYaml(file string) ([]byte, error) {
filepath, err := bazel.Runfile(prefix + file)
if err != nil {
return []byte{}, err
}
return ioutil.ReadFile(filepath)
}