aboutsummaryrefslogtreecommitdiffstats
path: root/dex/governance.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-25 11:17:52 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:52 +0800
commit2d1ed5288cab621aba39c3a81aae7042ead14fd5 (patch)
tree3312352700814c6e97305b84a58672ee1f059e66 /dex/governance.go
parentf5fa30b21ea123d66cf5fdaf527f546ef5a2f46b (diff)
downloaddexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar.gz
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar.bz2
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar.lz
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar.xz
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.tar.zst
dexon-2d1ed5288cab621aba39c3a81aae7042ead14fd5.zip
vendor: sync consensus core and fix conflict
Diffstat (limited to 'dex/governance.go')
-rw-r--r--dex/governance.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/dex/governance.go b/dex/governance.go
index c7ea440dd..69c1e217f 100644
--- a/dex/governance.go
+++ b/dex/governance.go
@@ -12,6 +12,7 @@ import (
coreCrypto "github.com/dexon-foundation/dexon-consensus-core/core/crypto"
coreEcdsa "github.com/dexon-foundation/dexon-consensus-core/core/crypto/ecdsa"
coreTypes "github.com/dexon-foundation/dexon-consensus-core/core/types"
+ dkgTypes "github.com/dexon-foundation/dexon-consensus-core/core/types/dkg"
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/core/types"
@@ -204,7 +205,7 @@ func (d *DexconGovernance) NotifyRoundHeight(targetRound, consensusHeight uint64
}
// AddDKGComplaint adds a DKGComplaint.
-func (d *DexconGovernance) AddDKGComplaint(round uint64, complaint *coreTypes.DKGComplaint) {
+func (d *DexconGovernance) AddDKGComplaint(round uint64, complaint *dkgTypes.Complaint) {
method := vm.GovernanceContractName2Method["addDKGComplaint"]
encoded, err := rlp.EncodeToBytes(complaint)
@@ -227,11 +228,11 @@ func (d *DexconGovernance) AddDKGComplaint(round uint64, complaint *coreTypes.DK
}
// DKGComplaints gets all the DKGComplaints of round.
-func (d *DexconGovernance) DKGComplaints(round uint64) []*coreTypes.DKGComplaint {
+func (d *DexconGovernance) DKGComplaints(round uint64) []*dkgTypes.Complaint {
s := d.getGovState()
- var dkgComplaints []*coreTypes.DKGComplaint
+ var dkgComplaints []*dkgTypes.Complaint
for _, pk := range s.DKGComplaints(big.NewInt(int64(round))) {
- x := new(coreTypes.DKGComplaint)
+ x := new(dkgTypes.Complaint)
if err := rlp.DecodeBytes(pk, x); err != nil {
panic(err)
}
@@ -241,7 +242,7 @@ func (d *DexconGovernance) DKGComplaints(round uint64) []*coreTypes.DKGComplaint
}
// AddDKGMasterPublicKey adds a DKGMasterPublicKey.
-func (d *DexconGovernance) AddDKGMasterPublicKey(round uint64, masterPublicKey *coreTypes.DKGMasterPublicKey) {
+func (d *DexconGovernance) AddDKGMasterPublicKey(round uint64, masterPublicKey *dkgTypes.MasterPublicKey) {
method := vm.GovernanceContractName2Method["addDKGMasterPublicKey"]
encoded, err := rlp.EncodeToBytes(masterPublicKey)
@@ -264,11 +265,11 @@ func (d *DexconGovernance) AddDKGMasterPublicKey(round uint64, masterPublicKey *
}
// DKGMasterPublicKeys gets all the DKGMasterPublicKey of round.
-func (d *DexconGovernance) DKGMasterPublicKeys(round uint64) []*coreTypes.DKGMasterPublicKey {
+func (d *DexconGovernance) DKGMasterPublicKeys(round uint64) []*dkgTypes.MasterPublicKey {
s := d.getGovState()
- var dkgMasterPKs []*coreTypes.DKGMasterPublicKey
+ var dkgMasterPKs []*dkgTypes.MasterPublicKey
for _, pk := range s.DKGMasterPublicKeys(big.NewInt(int64(round))) {
- x := new(coreTypes.DKGMasterPublicKey)
+ x := new(dkgTypes.MasterPublicKey)
if err := rlp.DecodeBytes(pk, x); err != nil {
panic(err)
}
@@ -278,7 +279,7 @@ func (d *DexconGovernance) DKGMasterPublicKeys(round uint64) []*coreTypes.DKGMas
}
// AddDKGFinalize adds a DKG finalize message.
-func (d *DexconGovernance) AddDKGFinalize(round uint64, final *coreTypes.DKGFinalize) {
+func (d *DexconGovernance) AddDKGFinalize(round uint64, final *dkgTypes.Finalize) {
method := vm.GovernanceContractName2Method["addDKGFinalize"]
encoded, err := rlp.EncodeToBytes(final)