prysm-pulse/shared/params/testutils.go
Preston Van Loon a9bbbae19a
Refactor params/config to separate files for clarity (#6427)
* split mainnet/onyx/altona/e2e configs into different files
* set onyx as the default network
* lint and fix comment
* more commentary
* gofmt
* Merge branch 'master' of github.com:prysmaticlabs/prysm into onyx-config
* gofmt
2020-06-27 00:20:24 +00:00

17 lines
525 B
Go

package params
import "testing"
// SetupTestConfigCleanup preserves configurations allowing to modify them within tests without any
// restrictions, everything is restored after the test.
func SetupTestConfigCleanup(t *testing.T) {
prevDefaultBeaconConfig := mainnetBeaconConfig.Copy()
prevBeaconConfig := beaconConfig.Copy()
prevNetworkCfg := mainnetNetworkConfig.Copy()
t.Cleanup(func() {
mainnetBeaconConfig = prevDefaultBeaconConfig
beaconConfig = prevBeaconConfig
mainnetNetworkConfig = prevNetworkCfg
})
}