2021-09-21 15:02:48 +00:00
|
|
|
package params_test
|
2021-08-25 17:18:29 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2021-09-21 15:02:48 +00:00
|
|
|
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/config/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/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
|
|
|
}
|
2021-08-25 17:18:29 +00:00
|
|
|
configFP := testnetConfigFilePath(t, "prater")
|
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
|
|
|
}
|