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@byzantine-lab.io>2019-06-12 17:27:17 +0800
commitdcb706ee7a9a497527dff649d8cf7d37a1d8fb2d (patch)
tree2f186f3a17f5c0241b3e21a07101f18f76ca70f8 /dex/governance.go
parentf80216879307f6fa21b5937e3644e417226d9467 (diff)
downloadgo-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar.gz
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar.bz2
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar.lz
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar.xz
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.tar.zst
go-tangerine-dcb706ee7a9a497527dff649d8cf7d37a1d8fb2d.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)