diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-08-14 23:48:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 23:48:40 +0800 |
commit | c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368 (patch) | |
tree | b6eb1a43c11f796cbcdd6267298d7f41ac4dad1b /simulation | |
parent | 763404d4158c917297012cf06634eb1697b459d6 (diff) | |
download | dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar.gz dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar.bz2 dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar.lz dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar.xz dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.tar.zst dexon-consensus-c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368.zip |
core: Prepare Genesis block. (#54)
Diffstat (limited to 'simulation')
-rw-r--r-- | simulation/validator.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/simulation/validator.go b/simulation/validator.go index 7ebf06b..1912bf6 100644 --- a/simulation/validator.go +++ b/simulation/validator.go @@ -92,13 +92,10 @@ func (v *Validator) Run() { genesisBlock := &types.Block{ ProposerID: v.ID, - ParentHash: common.Hash{}, - Hash: common.NewRandomHash(), - Height: 0, - Acks: map[common.Hash]struct{}{}, - Timestamps: map[types.ValidatorID]time.Time{ - v.ID: time.Now().UTC(), - }, + } + err := v.consensus.PrepareGenesisBlock(genesisBlock, time.Now().UTC()) + if err != nil { + panic(err) } isStopped := make(chan struct{}, 2) isShutdown := make(chan struct{}) |