From 15613bf756a23095dd6e698c5973822df480ade3 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Sat, 20 Oct 2018 14:49:03 +0800 Subject: dex: fix DKGMasterPublicKey and DKGComplaints unmarshal --- dex/governance.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dex/governance.go b/dex/governance.go index 50ab7ee14..17f7f0751 100644 --- a/dex/governance.go +++ b/dex/governance.go @@ -20,7 +20,6 @@ import ( "github.com/dexon-foundation/dexon/crypto" "github.com/dexon-foundation/dexon/log" "github.com/dexon-foundation/dexon/params" - "github.com/dexon-foundation/dexon/rlp" "github.com/dexon-foundation/dexon/rpc" ) @@ -226,7 +225,7 @@ func (d *DexconGovernance) DKGComplaints(round uint64) []*coreTypes.DKGComplaint var dkgComplaints []*coreTypes.DKGComplaint for _, pk := range s.DKGComplaints(big.NewInt(int64(round))) { x := new(coreTypes.DKGComplaint) - if err := rlp.DecodeBytes(pk, x); err != nil { + if err := json.Unmarshal(pk, x); err != nil { panic(err) } dkgComplaints = append(dkgComplaints, x) @@ -263,7 +262,7 @@ func (d *DexconGovernance) DKGMasterPublicKeys(round uint64) []*coreTypes.DKGMas var dkgMasterPKs []*coreTypes.DKGMasterPublicKey for _, pk := range s.DKGMasterPublicKeys(big.NewInt(int64(round))) { x := new(coreTypes.DKGMasterPublicKey) - if err := rlp.DecodeBytes(pk, x); err != nil { + if err := json.Unmarshal(pk, x); err != nil { panic(err) } dkgMasterPKs = append(dkgMasterPKs, x) -- cgit v1.2.3