mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
27 lines
638 B
Go
27 lines
638 B
Go
package blockchain
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
|
|
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
|
|
)
|
|
|
|
func TestVerifyCheckpointEpoch_Ok(t *testing.T) {
|
|
helpers.ClearCache()
|
|
db, sc := testDB.SetupDB(t)
|
|
|
|
chainService := setupBeaconChain(t, db, sc)
|
|
chainService.genesisTime = time.Now()
|
|
|
|
if !chainService.verifyCheckpointEpoch(ðpb.Checkpoint{}) {
|
|
t.Error("Wanted true, got false")
|
|
}
|
|
|
|
if chainService.verifyCheckpointEpoch(ðpb.Checkpoint{Epoch: 1}) {
|
|
t.Error("Wanted false, got true")
|
|
}
|
|
}
|