aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-18 09:07:52 +0800
committerGitHub <noreply@github.com>2018-09-18 09:07:52 +0800
commit81cf96477127a2da8843d544802027c7061a9c06 (patch)
tree70c06aec5df92df1dd93b605cc7afdbd2b8b0347 /core/consensus_test.go
parent8a908e98279d7e80978cd412057eddd4a6bbf06c (diff)
downloaddexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.gz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.bz2
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.lz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.xz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.zst
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.zip
core: remove ticker parameter from NewConsensus
- remove BlockProposingInterval, it's replaced by lambda. - remove ticker parameter of NewConsensus, ticker would be derived from governance. - leave a backdoor to hook the construction of ticker. - move 'Lambda' config from to consensus.
Diffstat (limited to 'core/consensus_test.go')
-rw-r--r--core/consensus_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/consensus_test.go b/core/consensus_test.go
index 1e97993..e799675 100644
--- a/core/consensus_test.go
+++ b/core/consensus_test.go
@@ -83,8 +83,7 @@ func (s *ConsensusTestSuite) prepareConsensus(
s.Require().Nil(err)
prv, exist := gov.PrivateKeys[vID]
s.Require().True(exist)
- con := NewConsensus(app, gov, db,
- &network{}, time.NewTicker(1), prv, eth.SigToPub)
+ con := NewConsensus(app, gov, db, &network{}, prv, eth.SigToPub)
return &con.app, con
}
@@ -102,7 +101,7 @@ func (s *ConsensusTestSuite) TestSimpleDeliverBlock() {
// This test case only works for Total Ordering with K=0.
var (
minInterval = 50 * time.Millisecond
- gov, err = test.NewGovernance(4, 1000)
+ gov, err = test.NewGovernance(4, time.Second)
req = s.Require()
validators []types.ValidatorID
)
@@ -325,7 +324,7 @@ func (s *ConsensusTestSuite) TestPrepareBlock() {
// - Make sure Consensus.PrepareBlock would only attempt to
// ack the prepared block.
var (
- gov, err = test.NewGovernance(4, 1000)
+ gov, err = test.NewGovernance(4, time.Second)
req = s.Require()
validators []types.ValidatorID
)
@@ -381,7 +380,7 @@ func (s *ConsensusTestSuite) TestPrepareBlock() {
func (s *ConsensusTestSuite) TestPrepareGenesisBlock() {
var (
- gov, err = test.NewGovernance(4, 1000)
+ gov, err = test.NewGovernance(4, time.Second)
validators []types.ValidatorID
)
s.Require().Nil(err)