mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
054b15bc45
* Flag * Service * Tests * Tests and comments * Lint * Add to usages Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
28 lines
649 B
Go
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)
|
|
}
|
|
}
|
|
}
|