prysm-pulse/shared/params/config_test.go
terence tsao ecbf50c2fe Use Validator Status in Proto (#1082)
* use validator status code in proto

* typo & constant casing
2018-12-11 22:40:17 -06:00

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)
}
}