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/test/utils.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/test/utils.go')
-rw-r--r-- | core/test/utils.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/test/utils.go b/core/test/utils.go index 74cde45..e02e194 100644 --- a/core/test/utils.go +++ b/core/test/utils.go @@ -170,6 +170,20 @@ func CloneDKGFinalize(final *typesDKG.Finalize) ( return } +// CloneDKGSuccess clones a typesDKG.Success instance. +func CloneDKGSuccess(success *typesDKG.Success) ( + copied *typesDKG.Success) { + b, err := rlp.EncodeToBytes(success) + if err != nil { + panic(err) + } + copied = &typesDKG.Success{} + if err = rlp.DecodeBytes(b, copied); err != nil { + panic(err) + } + return +} + // CloneDKGPrivateShare clones a typesDKG.PrivateShare instance. func CloneDKGPrivateShare(prvShare *typesDKG.PrivateShare) ( copied *typesDKG.PrivateShare) { |