aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-23 20:51:05 +0800
committerGitHub <noreply@github.com>2018-09-23 20:51:05 +0800
commit0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89 (patch)
tree626db6969aee92702001e5c9f3de56e2a439ccac /core/test
parent2c71e8448a9c03e924a7869351eebf2def1af057 (diff)
downloadtangerine-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.gz
tangerine-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.zst
tangerine-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.zip
core: run first DKG at startup. (#129)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/governance.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/test/governance.go b/core/test/governance.go
index 63462d0..e486afe 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -34,7 +34,8 @@ var (
// Governance is an implementation of Goverance for testing purpose.
type Governance struct {
- lambda time.Duration
+ lambdaBA time.Duration
+ lambdaDKG time.Duration
notarySet map[types.NodeID]struct{}
privateKeys map[types.NodeID]crypto.PrivateKey
DKGComplaint map[uint64][]*types.DKGComplaint
@@ -45,7 +46,8 @@ type Governance struct {
func NewGovernance(nodeCount int, lambda time.Duration) (
g *Governance, err error) {
g = &Governance{
- lambda: lambda,
+ lambdaBA: lambda,
+ lambdaDKG: lambda * 10,
notarySet: make(map[types.NodeID]struct{}),
privateKeys: make(map[types.NodeID]crypto.PrivateKey),
DKGComplaint: make(map[uint64][]*types.DKGComplaint),
@@ -80,7 +82,8 @@ func (g *Governance) GetConfiguration(blockHeight uint64) *types.Config {
NumShards: 1,
NumChains: uint32(len(g.notarySet)),
GenesisCRS: "__ DEXON",
- Lambda: g.lambda,
+ LambdaBA: g.lambdaBA,
+ LambdaDKG: g.lambdaDKG,
K: 0,
PhiRatio: 0.667,
}