aboutsummaryrefslogtreecommitdiffstats
path: root/core/reliable-broadcast_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-21 10:43:01 +0800
committerGitHub <noreply@github.com>2018-09-21 10:43:01 +0800
commit2afaae9935576049d6967ee8aca02e33ac14b229 (patch)
tree096ddb41ac69c0f5ea911d9eb9db1f2eee81c97c /core/reliable-broadcast_test.go
parent441e7c082608f274a920eff64bc83ab27ab52ccb (diff)
downloadtangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar.gz
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar.bz2
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar.lz
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar.xz
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.tar.zst
tangerine-consensus-2afaae9935576049d6967ee8aca02e33ac14b229.zip
test: fix block generator (#126)
* Generate correct hash/signature when generating blocks. * Refine naming, types. - type of chainNum should be uint32 by default - rename blockCount to blockNum - rename nodeCount to chainNum
Diffstat (limited to 'core/reliable-broadcast_test.go')
-rw-r--r--core/reliable-broadcast_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/reliable-broadcast_test.go b/core/reliable-broadcast_test.go
index cf82949..0e627d1 100644
--- a/core/reliable-broadcast_test.go
+++ b/core/reliable-broadcast_test.go
@@ -545,9 +545,9 @@ func (s *ReliableBroadcastTest) TestRandomIntensiveAcking() {
func (s *ReliableBroadcastTest) TestRandomlyGeneratedBlocks() {
var (
- nodeCount = 19
- blockCount = 50
- repeat = 20
+ chainNum = uint32(19)
+ blockNum = 50
+ repeat = 20
)
// Prepare a randomly generated blocks.
@@ -560,7 +560,7 @@ func (s *ReliableBroadcastTest) TestRandomlyGeneratedBlocks() {
}
}()
gen := test.NewBlocksGenerator(nil, hashBlock)
- _, err = gen.Generate(nodeCount, blockCount, nil, db)
+ _, err = gen.Generate(chainNum, blockNum, nil, db)
s.Require().Nil(err)
iter, err := db.GetAll()
s.Require().Nil(err)
@@ -572,7 +572,7 @@ func (s *ReliableBroadcastTest) TestRandomlyGeneratedBlocks() {
for i := 0; i < repeat; i++ {
nodes := map[types.NodeID]struct{}{}
rb := newReliableBroadcast()
- rb.setChainNum(uint32(nodeCount))
+ rb.setChainNum(chainNum)
stronglyAckedHashes := common.Hashes{}
revealer.Reset()