diff options
Diffstat (limited to 'core/test/app_test.go')
-rw-r--r-- | core/test/app_test.go | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/core/test/app_test.go b/core/test/app_test.go index 7ac9ef9..1579549 100644 --- a/core/test/app_test.go +++ b/core/test/app_test.go @@ -71,12 +71,16 @@ func (s *AppTestSuite) prepareGov() *Governance { return gov } -func (s *AppTestSuite) proposeMPK(gov *Governance, round uint64, count int) { +func (s *AppTestSuite) proposeMPK( + gov *Governance, + round, reset uint64, + count int) { for idx, pubKey := range s.pubKeys[:count] { _, pubShare := dkg.NewPrivateKeyShares(utils.GetDKGThreshold( gov.Configuration(round))) mpk := &typesDKG.MasterPublicKey{ Round: round, + Reset: reset, DKGID: typesDKG.NewID(types.NewNodeID(pubKey)), PublicKeyShares: *pubShare, } @@ -85,12 +89,15 @@ func (s *AppTestSuite) proposeMPK(gov *Governance, round uint64, count int) { } } -func (s *AppTestSuite) proposeFinalize(gov *Governance, round uint64, +func (s *AppTestSuite) proposeFinalize( + gov *Governance, + round, reset uint64, count int) { for idx, pubKey := range s.pubKeys[:count] { final := &typesDKG.Finalize{ ProposerID: types.NewNodeID(pubKey), Round: round, + Reset: reset, } s.Require().NoError(s.signers[idx].SignDKGFinalize(final)) gov.AddDKGFinalize(round, final) @@ -286,17 +293,17 @@ func (s *AppTestSuite) TestAttachedWithRoundEvent() { // Reset round#20 twice, then make it done DKG preparation. gov.ResetDKG(getCRS(20, 1)) gov.ResetDKG(getCRS(20, 2)) - s.proposeMPK(gov, 20, 3) - s.proposeFinalize(gov, 20, 3) + s.proposeMPK(gov, 20, 2, 3) + s.proposeFinalize(gov, 20, 2, 3) s.Require().Equal(gov.DKGResetCount(20), uint64(2)) // Propose CRS for round#21, and it works without reset. gov.ProposeCRS(21, getCRS(21, 0)) - s.proposeMPK(gov, 21, 3) - s.proposeFinalize(gov, 21, 3) + s.proposeMPK(gov, 21, 0, 3) + s.proposeFinalize(gov, 21, 0, 3) // Propose CRS for round#22, and it works without reset. gov.ProposeCRS(22, getCRS(22, 0)) - s.proposeMPK(gov, 22, 3) - s.proposeFinalize(gov, 22, 3) + s.proposeMPK(gov, 22, 0, 3) + s.proposeFinalize(gov, 22, 0, 3) // Prepare utils.RoundEvent, starts from round#19, reset(for round#20)#1. rEvt, err := utils.NewRoundEvent(context.Background(), gov, s.logger, 19, 1900, 2019, core.ConfigRoundShift) |