prysm-pulse/shared/params/config_test.go
Victor Farazdagi af5b9222da
Re-enable skipped block list paging unit test (#5691)
* unskip on a single shard
* Merge branch 'master' into unskip-block-list-test
* fixes incorrect test state modification
* Merge branch 'master' into unskip-block-list-test
* minor formatting
* Merge branch 'unskip-block-list-test' of github.com:prysmaticlabs/prysm into unskip-block-list-test
* set sharding back to 4
* Merge refs/heads/master into unskip-block-list-test
* Merge refs/heads/master into unskip-block-list-test
* Merge refs/heads/master into unskip-block-list-test
2020-05-02 04:03:50 +00:00

34 lines
998 B
Go

package params_test
import (
"testing"
"github.com/prysmaticlabs/prysm/shared/params"
)
func TestOverrideBeaconConfig(t *testing.T) {
cfg := params.BeaconConfig()
cfg.SlotsPerEpoch = 5
params.OverrideBeaconConfig(cfg)
if c := params.BeaconConfig(); c.SlotsPerEpoch != 5 {
t.Errorf("Shardcount in BeaconConfig incorrect. Wanted %d, got %d", 5, c.SlotsPerEpoch)
}
}
func TestOverrideBeaconConfigWithReset(t *testing.T) {
cfg := params.BeaconConfig().Copy()
origSlotsPerEpoch := cfg.SlotsPerEpoch
newSlotsPerEpoch := origSlotsPerEpoch + 42
cfg.SlotsPerEpoch = newSlotsPerEpoch
resetFunc := params.OverrideBeaconConfigWithReset(cfg)
if c := params.BeaconConfig(); c.SlotsPerEpoch != newSlotsPerEpoch {
t.Errorf("Config value is incorrect, want: %d, got %d", newSlotsPerEpoch, c.SlotsPerEpoch)
}
resetFunc()
if c := params.BeaconConfig(); c.SlotsPerEpoch != origSlotsPerEpoch {
t.Errorf("Config value is incorrect, want: %d, got %d", origSlotsPerEpoch, c.SlotsPerEpoch)
}
}