diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-09-18 09:07:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 09:07:52 +0800 |
commit | 81cf96477127a2da8843d544802027c7061a9c06 (patch) | |
tree | 70c06aec5df92df1dd93b605cc7afdbd2b8b0347 /integration_test | |
parent | 8a908e98279d7e80978cd412057eddd4a6bbf06c (diff) | |
download | dexon-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 'integration_test')
-rw-r--r-- | integration_test/utils.go | 4 | ||||
-rw-r--r-- | integration_test/validator.go | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/integration_test/utils.go b/integration_test/utils.go index de7e6ab..57bb2bc 100644 --- a/integration_test/utils.go +++ b/integration_test/utils.go @@ -1,6 +1,8 @@ package integration import ( + "time" + "github.com/dexon-foundation/dexon-consensus-core/core/blockdb" "github.com/dexon-foundation/dexon-consensus-core/core/test" "github.com/dexon-foundation/dexon-consensus-core/core/types" @@ -25,7 +27,7 @@ func PrepareValidators( dbs = make(map[types.ValidatorID]blockdb.BlockDatabase) validators = make(map[types.ValidatorID]*Validator) - gov, err := test.NewGovernance(validatorCount, 700) + gov, err := test.NewGovernance(validatorCount, 700*time.Millisecond) if err != nil { return } diff --git a/integration_test/validator.go b/integration_test/validator.go index a110ab0..18e5c00 100644 --- a/integration_test/validator.go +++ b/integration_test/validator.go @@ -102,8 +102,7 @@ func NewValidator( networkLatency: networkLatency, proposingLatency: proposingLatency, cons: core.NewConsensus( - app, gov, - db, &Network{}, time.NewTicker(1), privateKey, eth.SigToPub), + app, gov, db, &Network{}, privateKey, eth.SigToPub), } } |