aboutsummaryrefslogtreecommitdiffstats
path: root/core/configuration-chain_test.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-04 18:30:03 +0800
committerGitHub <noreply@github.com>2019-03-04 18:30:03 +0800
commitd4b4c8a05e94f66c85e7b4238ae5947b26f13c40 (patch)
treec2a10260820ac3a152506000aa03c41cd244d84f /core/configuration-chain_test.go
parent603f8d6d999c1bb5b16c2f5dfc88f8bc9da7fc33 (diff)
downloaddexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar.gz
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar.bz2
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar.lz
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar.xz
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.tar.zst
dexon-consensus-d4b4c8a05e94f66c85e7b4238ae5947b26f13c40.zip
core: first few round will not have DKG (#455)
* core: Add DKGDelayRound constant * core: use constant value * core, utils: set DKGDelayRound for utils. * test: add dkgDelayRound to state * core: do not run dkg and crs for round < DKGDelayRound * fix test
Diffstat (limited to 'core/configuration-chain_test.go')
-rw-r--r--core/configuration-chain_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/configuration-chain_test.go b/core/configuration-chain_test.go
index 1fe54bc..939cf65 100644
--- a/core/configuration-chain_test.go
+++ b/core/configuration-chain_test.go
@@ -202,7 +202,7 @@ func (s *ConfigurationChainTestSuite) runDKG(
recv := newTestCCGlobalReceiver(s)
for _, nID := range s.nIDs {
- gov, err := test.NewGovernance(test.NewState(
+ gov, err := test.NewGovernance(test.NewState(DKGDelayRound,
s.pubKeys, 100*time.Millisecond, &common.NullLogger{}, true,
), ConfigRoundShift)
s.Require().NoError(err)
@@ -271,7 +271,7 @@ func (s *ConfigurationChainTestSuite) preparePartialSignature(
func (s *ConfigurationChainTestSuite) TestConfigurationChain() {
k := 4
n := 10
- round := uint64(0)
+ round := DKGDelayRound
cfgChains := s.runDKG(k, n, round)
hash := crypto.Keccak256Hash([]byte("🌚🌝"))
@@ -316,7 +316,7 @@ func (s *ConfigurationChainTestSuite) TestConfigurationChain() {
func (s *ConfigurationChainTestSuite) TestDKGMasterPublicKeyDelayAdd() {
k := 4
n := 10
- round := uint64(0)
+ round := DKGDelayRound
lambdaDKG := 1000 * time.Millisecond
s.setupNodes(n)
@@ -325,7 +325,7 @@ func (s *ConfigurationChainTestSuite) TestDKGMasterPublicKeyDelayAdd() {
delayNode := s.nIDs[0]
for _, nID := range s.nIDs {
- state := test.NewState(
+ state := test.NewState(DKGDelayRound,
s.pubKeys, 100*time.Millisecond, &common.NullLogger{}, true)
gov, err := test.NewGovernance(state, ConfigRoundShift)
s.Require().NoError(err)
@@ -382,7 +382,7 @@ func (s *ConfigurationChainTestSuite) TestDKGMasterPublicKeyDelayAdd() {
func (s *ConfigurationChainTestSuite) TestDKGComplaintDelayAdd() {
k := 4
n := 10
- round := uint64(0)
+ round := DKGDelayRound
lambdaDKG := 1000 * time.Millisecond
s.setupNodes(n)
@@ -390,7 +390,7 @@ func (s *ConfigurationChainTestSuite) TestDKGComplaintDelayAdd() {
recv := newTestCCGlobalReceiver(s)
recvs := make(map[types.NodeID]*testCCReceiver)
for _, nID := range s.nIDs {
- state := test.NewState(
+ state := test.NewState(DKGDelayRound,
s.pubKeys, 100*time.Millisecond, &common.NullLogger{}, true)
gov, err := test.NewGovernance(state, ConfigRoundShift)
s.Require().NoError(err)
@@ -458,7 +458,7 @@ func (s *ConfigurationChainTestSuite) TestDKGComplaintDelayAdd() {
func (s *ConfigurationChainTestSuite) TestMultipleTSig() {
k := 2
n := 7
- round := uint64(0)
+ round := DKGDelayRound
cfgChains := s.runDKG(k, n, round)
hash1 := crypto.Keccak256Hash([]byte("Hash1"))
@@ -518,7 +518,7 @@ func (s *ConfigurationChainTestSuite) TestMultipleTSig() {
func (s *ConfigurationChainTestSuite) TestTSigTimeout() {
k := 2
n := 7
- round := uint64(0)
+ round := DKGDelayRound
cfgChains := s.runDKG(k, n, round)
timeout := 6 * time.Second
@@ -555,7 +555,7 @@ func (s *ConfigurationChainTestSuite) TestTSigTimeout() {
func (s *ConfigurationChainTestSuite) TestDKGSignerRecoverFromDB() {
k := 2
n := 7
- round := uint64(0)
+ round := DKGDelayRound
cfgChains := s.runDKG(k, n, round)
hash := crypto.Keccak256Hash([]byte("Hash1"))
// Make sure we have more than one configurationChain instance.