prysm-pulse/beacon-chain/state/stategen/service_test.go
terence tsao 054b15bc45
Add SlotsPerArchivedPoint flag and a check (#5023)
* Flag

* Service

* Tests

* Tests and comments

* Lint

* Add to usages

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-03-06 17:06:01 -06:00

28 lines
649 B
Go

package stategen
import (
"testing"
"github.com/prysmaticlabs/prysm/shared/params"
)
func Test_verifySlotsPerArchivePoint(t *testing.T) {
type tc struct {
input uint64
result bool
}
tests := []tc{
{0, false},
{1, false},
{params.BeaconConfig().SlotsPerEpoch, true},
{params.BeaconConfig().SlotsPerEpoch + 1, false},
{params.BeaconConfig().SlotsPerHistoricalRoot, true},
{params.BeaconConfig().SlotsPerHistoricalRoot + 1, false},
}
for _, tt := range tests {
if got := verifySlotsPerArchivePoint(tt.input); got != tt.result {
t.Errorf("verifySlotsPerArchivePoint(%d) = %v, want %v", tt.input, got, tt.result)
}
}
}