mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-29 06:37:17 +00:00
34 lines
843 B
Go
34 lines
843 B
Go
|
package sync
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
"time"
|
||
|
|
||
|
mockChain "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing"
|
||
|
p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
|
||
|
stateTrie "github.com/prysmaticlabs/prysm/beacon-chain/state"
|
||
|
mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing"
|
||
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||
|
)
|
||
|
|
||
|
func TestService_StatusZeroEpoch(t *testing.T) {
|
||
|
bState, err := stateTrie.InitializeFromProto(&pb.BeaconState{Slot: 0})
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
r := &Service{
|
||
|
p2p: p2ptest.NewTestP2P(t),
|
||
|
initialSync: new(mockSync.Sync),
|
||
|
chain: &mockChain.ChainService{
|
||
|
Genesis: time.Now(),
|
||
|
State: bState,
|
||
|
},
|
||
|
}
|
||
|
r.chainStarted = true
|
||
|
|
||
|
err = r.Status()
|
||
|
if err != nil {
|
||
|
t.Errorf("Wanted non failing status but got: %v", err)
|
||
|
}
|
||
|
}
|