prysm-pulse/shared/params/spectest/config.go
Raul Jordan 546196a6fa
Other Package Godocs for Prysm (#5681)
* e2e docs
* slasher docs
* Merge branch 'other-package-godocs' of github.com:prysmaticlabs/prysm into other-package-godocs
* all validator package comments
* Merge branch 'master' into other-package-godocs
* completed all other packages
* Merge branch 'master' into other-package-godocs
* Merge refs/heads/master into other-package-godocs
2020-04-29 21:32:39 +00:00

29 lines
725 B
Go

// Package spectest allows for easy switching of chain
// configuration parameters in spec conformity unit tests.
package spectest
import (
"errors"
"fmt"
"github.com/prysmaticlabs/prysm/shared/params"
)
// SetConfig sets the global params for spec tests depending on the option chosen.
func SetConfig(config string) error {
switch config {
case "minimal":
newConfig := params.MinimalSpecConfig()
params.OverrideBeaconConfig(newConfig)
return nil
case "mainnet":
newConfig := params.MainnetConfig()
params.OverrideBeaconConfig(newConfig)
return nil
case "":
return errors.New("no config provided")
default:
return fmt.Errorf("did not receive a valid config, instead received this %s", config)
}
}