aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/blocks-generator_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-22 12:54:03 +0800
committerGitHub <noreply@github.com>2018-12-22 12:54:03 +0800
commit6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6 (patch)
tree1895248f011a356fcd2a28c03dbda9d93fd46fd8 /core/test/blocks-generator_test.go
parent146ed32cf841151b826eafd7d6ade188c56865bf (diff)
downloaddexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.gz
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.zst
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.zip
utils: move authenticator to utils package (#378)
Diffstat (limited to 'core/test/blocks-generator_test.go')
-rw-r--r--core/test/blocks-generator_test.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/core/test/blocks-generator_test.go b/core/test/blocks-generator_test.go
index d71cd62..bcbd749 100644
--- a/core/test/blocks-generator_test.go
+++ b/core/test/blocks-generator_test.go
@@ -39,7 +39,7 @@ func (s *BlocksGeneratorTestSuite) TestGenerate() {
NumChains: 19,
MinBlockTimeInterval: 200 * time.Millisecond,
}
- gen = NewBlocksGenerator(config, nil, stableRandomHash)
+ gen = NewBlocksGenerator(config, nil)
req = s.Require()
beginTime = time.Now().UTC()
endTime = beginTime.Add(time.Minute)
@@ -129,8 +129,7 @@ func (s *BlocksGeneratorTestSuite) TestGenerateWithMaxAckCount() {
// Generate with 0 acks.
dbInst, err := db.NewMemBackedDB()
req.NoError(err)
- gen := NewBlocksGenerator(
- config, MaxAckingCountGenerator(0), stableRandomHash)
+ gen := NewBlocksGenerator(config, MaxAckingCountGenerator(0))
req.NoError(gen.Generate(
0,
genesisTime,
@@ -153,8 +152,7 @@ func (s *BlocksGeneratorTestSuite) TestGenerateWithMaxAckCount() {
// Generate with acks as many as possible.
dbInst, err = db.NewMemBackedDB()
req.NoError(err)
- gen = NewBlocksGenerator(
- config, MaxAckingCountGenerator(config.NumChains), stableRandomHash)
+ gen = NewBlocksGenerator(config, MaxAckingCountGenerator(config.NumChains))
req.NoError(gen.Generate(
0,
genesisTime,
@@ -190,7 +188,7 @@ func (s *BlocksGeneratorTestSuite) TestFindTips() {
genesisTime = time.Now().UTC()
endTime = genesisTime.Add(100 * time.Second)
)
- gen := NewBlocksGenerator(config, nil, stableRandomHash)
+ gen := NewBlocksGenerator(config, nil)
dbInst, err := db.NewMemBackedDB()
req.NoError(err)
req.NoError(gen.Generate(
@@ -220,7 +218,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
gen := NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 4,
MinBlockTimeInterval: 250 * time.Millisecond,
- }, MaxAckingCountGenerator(4), stableRandomHash)
+ }, MaxAckingCountGenerator(4))
req.NoError(gen.Generate(
0,
genesisTime,
@@ -233,7 +231,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
gen = NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 10,
MinBlockTimeInterval: 250 * time.Millisecond,
- }, MaxAckingCountGenerator(10), stableRandomHash)
+ }, MaxAckingCountGenerator(10))
req.NoError(gen.Generate(
1,
genesisTime.Add(10*time.Second),
@@ -246,7 +244,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
gen = NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 7,
MinBlockTimeInterval: 250 * time.Millisecond,
- }, MaxAckingCountGenerator(7), stableRandomHash)
+ }, MaxAckingCountGenerator(7))
req.NoError(gen.Generate(
2,
genesisTime.Add(20*time.Second),