aboutsummaryrefslogtreecommitdiffstats
path: root/dex/governance.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-13 13:53:42 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit8dc2068251b779ea6b93a3e789a9ebdeb8497b5c (patch)
treeccb58975b5a6b8c1d079229c2bd61af43475f69d /dex/governance.go
parente64c5f223b625464eeea9415a8484eef71874534 (diff)
downloaddexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar.gz
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar.bz2
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar.lz
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar.xz
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.tar.zst
dexon-8dc2068251b779ea6b93a3e789a9ebdeb8497b5c.zip
dex: pass p2p nodeKey to Dexon instance
Diffstat (limited to 'dex/governance.go')
-rw-r--r--dex/governance.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/dex/governance.go b/dex/governance.go
index d2cfe05c6..8993152df 100644
--- a/dex/governance.go
+++ b/dex/governance.go
@@ -2,12 +2,13 @@ package dex
import (
"context"
+ "crypto/ecdsa"
"math/big"
"time"
coreCommon "github.com/dexon-foundation/dexon-consensus-core/common"
coreCrypto "github.com/dexon-foundation/dexon-consensus-core/core/crypto"
- "github.com/dexon-foundation/dexon-consensus-core/core/crypto/ecdsa"
+ coreEcdsa "github.com/dexon-foundation/dexon-consensus-core/core/crypto/ecdsa"
coreTypes "github.com/dexon-foundation/dexon-consensus-core/core/types"
"github.com/dexon-foundation/dexon/core/vm"
"github.com/dexon-foundation/dexon/rlp"
@@ -15,14 +16,16 @@ import (
)
type DexconGovernance struct {
- b *DexAPIBackend
+ b *DexAPIBackend
+ privateKey *ecdsa.PrivateKey
}
// NewDexconGovernance retruns a governance implementation of the DEXON
// consensus governance interface.
-func NewDexconGovernance(backend *DexAPIBackend) *DexconGovernance {
+func NewDexconGovernance(backend *DexAPIBackend, privKey *ecdsa.PrivateKey) *DexconGovernance {
return &DexconGovernance{
- b: backend,
+ b: backend,
+ privateKey: privKey,
}
}
@@ -95,11 +98,15 @@ func (d *DexconGovernance) NodeSet(round uint64) []coreCrypto.PublicKey {
var pks []coreCrypto.PublicKey
for _, n := range s.Nodes() {
- pks = append(pks, ecdsa.NewPublicKeyFromByteSlice(n.PublicKey))
+ pks = append(pks, coreEcdsa.NewPublicKeyFromByteSlice(n.PublicKey))
}
return pks
}
+// NotifyRoundHeight register the mapping between round and height.
+func (d *DexconGovernance) NotifyRoundHeight(targetRound, consensusHeight uint64) {
+}
+
// AddDKGComplaint adds a DKGComplaint.
func (d *DexconGovernance) AddDKGComplaint(round uint64, complaint *coreTypes.DKGComplaint) {
}