2021-09-21 15:02:48 +00:00
|
|
|
package params_test
|
2021-08-25 17:18:29 +00:00
|
|
|
|
|
|
|
import (
|
2024-01-02 15:31:57 +00:00
|
|
|
"path"
|
2021-08-25 17:18:29 +00:00
|
|
|
"testing"
|
2021-09-21 15:02:48 +00:00
|
|
|
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/build/bazel"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/config/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
2021-08-25 17:18:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestPraterConfigMatchesUpstreamYaml(t *testing.T) {
|
2021-09-28 20:02:12 +00:00
|
|
|
presetFPs := presetsFilePath(t, "mainnet")
|
2022-05-20 07:16:53 +00:00
|
|
|
mn, err := params.ByName(params.MainnetName)
|
|
|
|
require.NoError(t, err)
|
|
|
|
cfg := mn.Copy()
|
2021-09-28 20:02:12 +00:00
|
|
|
for _, fp := range presetFPs {
|
2022-05-20 07:16:53 +00:00
|
|
|
cfg, err = params.UnmarshalConfigFile(fp, cfg)
|
|
|
|
require.NoError(t, err)
|
2021-09-28 20:02:12 +00:00
|
|
|
}
|
2024-01-02 15:31:57 +00:00
|
|
|
fPath, err := bazel.Runfile("external/goerli_testnet")
|
|
|
|
require.NoError(t, err)
|
|
|
|
configFP := path.Join(fPath, "prater", "config.yaml")
|
2022-05-20 07:16:53 +00:00
|
|
|
pcfg, err := params.UnmarshalConfigFile(configFP, nil)
|
|
|
|
require.NoError(t, err)
|
2021-09-28 20:02:12 +00:00
|
|
|
fields := fieldsFromYamls(t, append(presetFPs, configFP))
|
2022-05-20 07:16:53 +00:00
|
|
|
assertYamlFieldsMatch(t, "prater", fields, pcfg, params.PraterConfig())
|
2021-08-25 17:18:29 +00:00
|
|
|
}
|