aboutsummaryrefslogtreecommitdiffstats
path: root/core/crypto_test.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-11 13:28:44 +0800
committerGitHub <noreply@github.com>2018-09-11 13:28:44 +0800
commit582a491aa0bcb784ac7b65ebbfb42139945ea703 (patch)
tree8589bad986f512455717728012c3d9edf3b68c4f /core/crypto_test.go
parent2439f49063d8498eadf26d4fa1220c5eac8412a8 (diff)
downloaddexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar.gz
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar.bz2
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar.lz
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar.xz
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.tar.zst
dexon-consensus-582a491aa0bcb784ac7b65ebbfb42139945ea703.zip
core: timestamp (#98)
Diffstat (limited to 'core/crypto_test.go')
-rw-r--r--core/crypto_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/crypto_test.go b/core/crypto_test.go
index 4fa0e1b..29a45f6 100644
--- a/core/crypto_test.go
+++ b/core/crypto_test.go
@@ -36,12 +36,11 @@ var myVID = types.ValidatorID{Hash: common.NewRandomHash()}
func (s *CryptoTestSuite) prepareBlock(prevBlock *types.Block) *types.Block {
acks := make(map[common.Hash]struct{})
- timestamps := make(map[types.ValidatorID]time.Time)
- timestamps[myVID] = time.Now().UTC()
+ now := time.Now().UTC()
if prevBlock == nil {
return &types.Block{
- Acks: acks,
- Timestamps: timestamps,
+ Acks: acks,
+ Timestamp: now,
Notary: types.Notary{
Timestamp: time.Now(),
Height: 0,
@@ -55,7 +54,7 @@ func (s *CryptoTestSuite) prepareBlock(prevBlock *types.Block) *types.Block {
return &types.Block{
ParentHash: prevBlock.Hash,
Acks: acks,
- Timestamps: timestamps,
+ Timestamp: now,
Position: types.Position{
Height: prevBlock.Position.Height + 1,
},