mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-13 13:43:30 +00:00
af5b9222da
* 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
34 lines
998 B
Go
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)
|
|
}
|
|
}
|