2022-03-14 20:58:13 +00:00
|
|
|
//go:build !develop
|
2021-01-04 20:48:39 +00:00
|
|
|
// +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.
|
2021-09-24 17:42:16 +00:00
|
|
|
func (b *BeaconChainConfig) Copy() *BeaconChainConfig {
|
|
|
|
config, ok := deepcopy.Copy(*b).(BeaconChainConfig)
|
2021-01-04 20:48:39 +00:00
|
|
|
if !ok {
|
|
|
|
config = *beaconConfig
|
|
|
|
}
|
|
|
|
return &config
|
|
|
|
}
|