aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorHaoping Ku <haoping.ku@dexon.org>2018-08-13 18:09:30 +0800
committerGitHub <noreply@github.com>2018-08-13 18:09:30 +0800
commitd4228f32b436f551e736079fe0f590405077652c (patch)
tree49c93c8e1736914a0ba78344408c7fd3ac880740 /core/test
parent3733e4c72dd1b16626bf257f4acb9a74f795d924 (diff)
downloaddexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar.gz
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar.bz2
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar.lz
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar.xz
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.tar.zst
dexon-consensus-d4228f32b436f551e736079fe0f590405077652c.zip
core: add nack module (#41)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/blocks-generator.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/test/blocks-generator.go b/core/test/blocks-generator.go
index 926ef5b..a26a901 100644
--- a/core/test/blocks-generator.go
+++ b/core/test/blocks-generator.go
@@ -151,12 +151,17 @@ func (vs *validatorSetStatus) proposeBlock(
parentHash = status.blocks[len(status.blocks)-1].Hash
}
+ ts := map[types.ValidatorID]time.Time{}
+ for vid := range vs.status {
+ ts[vid] = time.Time{}
+ }
newBlock := &types.Block{
ProposerID: proposerID,
ParentHash: parentHash,
Height: uint64(len(status.blocks)),
Acks: acks,
- // TODO(mission.liao): Generate timestamp randomly.
+ Timestamps: ts,
+ // TODO(mission.liao): Generate timestamp.
}
var err error
newBlock.Hash, err = vs.hashBlock(newBlock)