prysm-pulse/config/params/config_utils_prod.go
kasey 0b1a777d62
ran gofmt @ v1.17, these are the resulting changes (#10362)
* ran gofmt @ v1.17, these are the resulting changes

* fix some flaky tests that are tripping up this PR

* gofmt

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
2022-03-14 15:58:13 -05:00

33 lines
786 B
Go

//go:build !develop
// +build !develop
package params
import (
"github.com/mohae/deepcopy"
)
var beaconConfig = MainnetConfig()
// BeaconConfig retrieves beacon chain config.
func BeaconConfig() *BeaconChainConfig {
return beaconConfig
}
// OverrideBeaconConfig by replacing the config. The preferred pattern is to
// call BeaconConfig(), change the specific parameters, and then call
// OverrideBeaconConfig(c). Any subsequent calls to params.BeaconConfig() will
// return this new configuration.
func OverrideBeaconConfig(c *BeaconChainConfig) {
beaconConfig = c
}
// Copy returns a copy of the config object.
func (b *BeaconChainConfig) Copy() *BeaconChainConfig {
config, ok := deepcopy.Copy(*b).(BeaconChainConfig)
if !ok {
config = *beaconConfig
}
return &config
}