diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-09-21 10:43:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-21 10:43:01 +0800 |
commit | 2afaae9935576049d6967ee8aca02e33ac14b229 (patch) | |
tree | 096ddb41ac69c0f5ea911d9eb9db1f2eee81c97c /core/test/revealer_test.go | |
parent | 441e7c082608f274a920eff64bc83ab27ab52ccb (diff) | |
download | tangerine-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/test/revealer_test.go')
-rw-r--r-- | core/test/revealer_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/test/revealer_test.go b/core/test/revealer_test.go index 0c20520..859438c 100644 --- a/core/test/revealer_test.go +++ b/core/test/revealer_test.go @@ -35,9 +35,9 @@ type RevealerTestSuite struct { func (s *RevealerTestSuite) SetupSuite() { var ( - err error - nodeCount = 19 - blockCount = 50 + err error + chainNum = uint32(19) + blockNum = 50 ) // Setup block database. s.db, err = blockdb.NewMemBackedBlockDB() @@ -45,10 +45,9 @@ func (s *RevealerTestSuite) SetupSuite() { // Randomly generate blocks. gen := NewBlocksGenerator(nil, stableRandomHash) - nodes, err := gen.Generate( - nodeCount, blockCount, nil, s.db) + nodes, err := gen.Generate(chainNum, blockNum, nil, s.db) s.Require().Nil(err) - s.Require().Len(nodes, nodeCount) + s.Require().Len(nodes, int(chainNum)) // Cache the count of total generated block. iter, err := s.db.GetAll() |