2023-08-29 14:27:50 +00:00
|
|
|
package params_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/bazelbuild/rules_go/go/tools/bazel"
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/config/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
2023-08-29 14:27:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestHoleskyConfigMatchesUpstreamYaml(t *testing.T) {
|
|
|
|
presetFPs := presetsFilePath(t, "mainnet")
|
|
|
|
mn, err := params.ByName(params.MainnetName)
|
|
|
|
require.NoError(t, err)
|
|
|
|
cfg := mn.Copy()
|
|
|
|
for _, fp := range presetFPs {
|
|
|
|
cfg, err = params.UnmarshalConfigFile(fp, cfg)
|
|
|
|
require.NoError(t, err)
|
|
|
|
}
|
|
|
|
fPath, err := bazel.Runfile("external/holesky_testnet")
|
|
|
|
require.NoError(t, err)
|
|
|
|
configFP := path.Join(fPath, "custom_config_data", "config.yaml")
|
|
|
|
pcfg, err := params.UnmarshalConfigFile(configFP, nil)
|
|
|
|
require.NoError(t, err)
|
|
|
|
fields := fieldsFromYamls(t, append(presetFPs, configFP))
|
|
|
|
assertYamlFieldsMatch(t, "holesky", fields, pcfg, params.HoleskyConfig())
|
|
|
|
}
|