diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-12-21 12:03:28 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:19 +0800 |
commit | 1dae18a03ae58e4b98a81a1596fedb9cb2b893e6 (patch) | |
tree | 5a938edadfb36844a1b64fafc85c6b9124d69304 /vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go | |
parent | 1c3de255e5507b32116bb37ba206fe66d6edde35 (diff) | |
download | go-tangerine-1dae18a03ae58e4b98a81a1596fedb9cb2b893e6.tar.gz go-tangerine-1dae18a03ae58e4b98a81a1596fedb9cb2b893e6.tar.zst go-tangerine-1dae18a03ae58e4b98a81a1596fedb9cb2b893e6.zip |
core: vm: Add `MPKReady` to governance (#97)
* core/vm: Add DKGMPKReady
* param: update GenesisHash
* vendor: sync to latest core
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go index cecc4f16c..f021d1bfb 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go @@ -167,6 +167,27 @@ type PartialSignature struct { Signature crypto.Signature `json:"signature"` } +// MPKReady describe a dig ready message in DKG protocol. +type MPKReady struct { + ProposerID types.NodeID `json:"proposer_id"` + Round uint64 `json:"round"` + Signature crypto.Signature `json:"signature"` +} + +func (ready *MPKReady) String() string { + return fmt.Sprintf("DKGMPKReady{RP:%s Round:%d}", + ready.ProposerID.String()[:6], + ready.Round) +} + +// Equal check equality of two MPKReady instances. +func (ready *MPKReady) Equal(other *MPKReady) bool { + return ready.ProposerID.Equal(other.ProposerID) && + ready.Round == other.Round && + ready.Signature.Type == other.Signature.Type && + bytes.Compare(ready.Signature.Signature, other.Signature.Signature) == 0 +} + // Finalize describe a dig finalize message in DKG protocol. type Finalize struct { ProposerID types.NodeID `json:"proposer_id"` |