From 8218cb1525872cc0c7f09335305bcbed484153ad Mon Sep 17 00:00:00 2001 From: bojie Date: Mon, 18 Mar 2019 18:03:27 +0800 Subject: core: snapshot DKG protocol struct when finish any phase (#496) --- core/configuration-chain_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/configuration-chain_test.go') diff --git a/core/configuration-chain_test.go b/core/configuration-chain_test.go index 2edcade..3d8d1aa 100644 --- a/core/configuration-chain_test.go +++ b/core/configuration-chain_test.go @@ -583,6 +583,19 @@ func (s *ConfigurationChainTestSuite) TestDKGSignerRecoverFromDB() { } } +func (s *ConfigurationChainTestSuite) TestDKGPhasesSnapShot() { + k := 2 + n := 7 + round := DKGDelayRound + cfgChains := s.runDKG(k, n, round, 0) + + for _, cfgChain := range cfgChains { + info, err := cfgChain.db.GetDKGProtocol() + s.Require().NoError(err) + s.Require().Equal(uint64(7), info.Step) + } +} + func TestConfigurationChain(t *testing.T) { suite.Run(t, new(ConfigurationChainTestSuite)) } -- cgit