mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 19:21:19 +00:00
ecbf50c2fe
* use validator status code in proto * typo & constant casing
47 lines
951 B
Go
47 lines
951 B
Go
package params
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSpecialRecordTypes(t *testing.T) {
|
|
tests := []struct {
|
|
a SpecialRecordType
|
|
b int
|
|
}{
|
|
{a: Logout, b: 0},
|
|
{a: CasperSlashing, b: 1},
|
|
{a: ProposerSlashing, b: 2},
|
|
{a: DepositProof, b: 3},
|
|
}
|
|
for _, tt := range tests {
|
|
if int(tt.a) != tt.b {
|
|
t.Errorf("Incorrect special record types. Wanted: %d, Got: %d", int(tt.a), tt.b)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestValidatorSetDeltaFlags(t *testing.T) {
|
|
tests := []struct {
|
|
a ValidatorSetDeltaFlags
|
|
b int
|
|
}{
|
|
{a: Entry, b: 0},
|
|
{a: Exit, b: 1},
|
|
}
|
|
for _, tt := range tests {
|
|
if int(tt.a) != tt.b {
|
|
t.Errorf("Incorrect validator set delta flags. Wanted: %d, Got: %d", int(tt.a), tt.b)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestOverrideBeaconConfig(t *testing.T) {
|
|
cfg := BeaconConfig()
|
|
cfg.ShardCount = 5
|
|
OverrideBeaconConfig(cfg)
|
|
if c := BeaconConfig(); c.ShardCount != 5 {
|
|
t.Errorf("Shardcount in BeaconConfig incorrect. Wanted %d, got %d", 5, c.ShardCount)
|
|
}
|
|
}
|