diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-15 11:44:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 11:44:04 +0800 |
commit | 79be89a6b0b1d24b889e7c9fe0244026af4d49d0 (patch) | |
tree | bacd2dd8a224d2cffbe9965439707df7fa2888de /core/configuration-chain_test.go | |
parent | 7abe09214fbf04f9f1f7f4f6ec57cd1f924953d6 (diff) | |
download | tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar.gz tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar.bz2 tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar.lz tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar.xz tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.tar.zst tangerine-consensus-79be89a6b0b1d24b889e7c9fe0244026af4d49d0.zip |
core: Add DKGSuccess (#569)
* core: Add DKGSuccess
* core: reset if not enough of dkg success
Diffstat (limited to 'core/configuration-chain_test.go')
-rw-r--r-- | core/configuration-chain_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/configuration-chain_test.go b/core/configuration-chain_test.go index 61f0906..edaacf6 100644 --- a/core/configuration-chain_test.go +++ b/core/configuration-chain_test.go @@ -114,6 +114,12 @@ func (r *testCCGlobalReceiver) ProposeDKGFinalize(final *typesDKG.Finalize) { } } +func (r *testCCGlobalReceiver) ProposeDKGSuccess(success *typesDKG.Success) { + for _, gov := range r.govs { + gov.AddDKGSuccess(test.CloneDKGSuccess(success)) + } +} + type testCCReceiver struct { signer *utils.Signer recv *testCCGlobalReceiver @@ -176,6 +182,13 @@ func (r *testCCReceiver) ProposeDKGFinalize(final *typesDKG.Finalize) { r.recv.ProposeDKGFinalize(final) } +func (r *testCCReceiver) ProposeDKGSuccess(success *typesDKG.Success) { + if err := r.signer.SignDKGSuccess(success); err != nil { + panic(err) + } + r.recv.ProposeDKGSuccess(success) +} + func (s *ConfigurationChainTestSuite) setupNodes(n int) { s.nIDs = make(types.NodeIDs, 0, n) s.signers = make(map[types.NodeID]*utils.Signer, n) |