mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
f3d6dbcc1e
* config params into pkg * gaz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
32 lines
766 B
Go
32 lines
766 B
Go
// +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 (c *BeaconChainConfig) Copy() *BeaconChainConfig {
|
|
config, ok := deepcopy.Copy(*c).(BeaconChainConfig)
|
|
if !ok {
|
|
config = *beaconConfig
|
|
}
|
|
return &config
|
|
}
|