mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
17 lines
525 B
Go
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
|
||
|
})
|
||
|
}
|