mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
b6353da793
* add flag * add flag * gaz * fix lint * fix build issues * revert initial sync changes * fix tests * Update beacon-chain/sync/service.go Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
39 lines
946 B
Go
39 lines
946 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 init() {
|
|
allowedBlocksPerSecond = 64
|
|
allowedBlocksBurst = int64(10 * allowedBlocksPerSecond)
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|