mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Fixed Simulator Slot Alignment (#607)
This commit is contained in:
parent
593e3dcdf9
commit
aec2ea3b1b
@ -44,7 +44,7 @@ var defaultConfig = &Config{
|
||||
}
|
||||
|
||||
var demoConfig = &Config{
|
||||
GenesisTime: time.Now(),
|
||||
GenesisTime: time.Now().Add(-8 * time.Second),
|
||||
CycleLength: uint64(5),
|
||||
ShardCount: 3,
|
||||
DefaultBalance: new(big.Int).Div(big.NewInt(32), big.NewInt(int64(1e18))),
|
||||
|
@ -182,7 +182,7 @@ func (sim *Simulator) run(delayChan <-chan time.Time, done <-chan struct{}) {
|
||||
}
|
||||
|
||||
block := types.NewBlock(&pb.BeaconBlock{
|
||||
SlotNumber: sim.slotNum,
|
||||
SlotNumber: sim.chainService.CurrentBeaconSlot(),
|
||||
Timestamp: ptypes.TimestampNow(),
|
||||
PowChainRef: powChainRef,
|
||||
ActiveStateHash: activeStateHash[:],
|
||||
|
@ -55,6 +55,10 @@ func (mc *mockChainService) GenesisBlock() (*types.Block, error) {
|
||||
return types.NewGenesisBlock([32]byte{}, [32]byte{}), nil
|
||||
}
|
||||
|
||||
func (mc *mockChainService) CurrentBeaconSlot() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func TestLifecycle(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
db := database.NewKVStore()
|
||||
|
@ -52,6 +52,7 @@ type StateFetcher interface {
|
||||
CurrentActiveState() *ActiveState
|
||||
CurrentCrystallizedState() *CrystallizedState
|
||||
GenesisBlock() (*Block, error)
|
||||
CurrentBeaconSlot() uint64
|
||||
}
|
||||
|
||||
// POWChainService is an interface for a proof-of-work chain web3 service.
|
||||
|
Loading…
Reference in New Issue
Block a user