aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/blocks-generator.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/test/blocks-generator.go')
-rw-r--r--core/test/blocks-generator.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/core/test/blocks-generator.go b/core/test/blocks-generator.go
index e92ff5d..aab7f96 100644
--- a/core/test/blocks-generator.go
+++ b/core/test/blocks-generator.go
@@ -190,8 +190,6 @@ func (ns *nodeSetStatus) proposeBlock(
blockHeight = status.tip.Position.Height + 1
acks = append(acks, parentHash)
}
- // 10% of chance to produce empty block.
- empty := ns.randGen.Float32() < 0.1 && blockHeight > 0
chainID := ns.proposerChain[proposerID]
newBlock := &types.Block{
ParentHash: parentHash,
@@ -202,22 +200,16 @@ func (ns *nodeSetStatus) proposeBlock(
},
Timestamp: status.getNextBlockTime(ns.timePicker),
}
- if empty {
- newBlock.Acks = common.NewSortedHashes(common.Hashes{parentHash})
- } else {
- newBlock.ProposerID = proposerID
- newBlock.Acks = common.NewSortedHashes(acks)
- }
+ newBlock.ProposerID = proposerID
+ newBlock.Acks = common.NewSortedHashes(acks)
var err error
newBlock.Hash, err = ns.hashBlock(newBlock)
if err != nil {
return nil, err
}
- if !empty {
- newBlock.Signature, err = status.prvKey.Sign(newBlock.Hash)
- if err != nil {
- return nil, err
- }
+ newBlock.Signature, err = status.prvKey.Sign(newBlock.Hash)
+ if err != nil {
+ return nil, err
}
status.blocks = append(status.blocks, newBlock)
status.tip = newBlock