aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/dkg.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-23 20:51:05 +0800
committerGitHub <noreply@github.com>2018-09-23 20:51:05 +0800
commit0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89 (patch)
tree626db6969aee92702001e5c9f3de56e2a439ccac /core/types/dkg.go
parent2c71e8448a9c03e924a7869351eebf2def1af057 (diff)
downloaddexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.gz
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.bz2
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.lz
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.xz
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.tar.zst
dexon-consensus-0ab5a2d4f63ece79a4df32c6fb3ac710a954fd89.zip
core: run first DKG at startup. (#129)
Diffstat (limited to 'core/types/dkg.go')
-rw-r--r--core/types/dkg.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/types/dkg.go b/core/types/dkg.go
index d70bf98..ff0aa75 100644
--- a/core/types/dkg.go
+++ b/core/types/dkg.go
@@ -18,6 +18,8 @@
package types
import (
+ "fmt"
+
"github.com/dexon-foundation/dexon-consensus-core/crypto"
"github.com/dexon-foundation/dexon-consensus-core/crypto/dkg"
)
@@ -31,6 +33,15 @@ type DKGPrivateShare struct {
Signature crypto.Signature `json:"signature"`
}
+func (p *DKGPrivateShare) String() string {
+ return fmt.Sprintf("prvShare(%d:%s->%s:%s:%s)",
+ p.Round,
+ p.ProposerID.String()[:6],
+ p.ReceiverID.String()[:6],
+ p.PrivateShare.String(),
+ p.Signature.String()[:6])
+}
+
// DKGMasterPublicKey decrtibe a master public key in DKG protocol.
type DKGMasterPublicKey struct {
ProposerID NodeID `json:"proposer_id"`