diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-20 14:49:03 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:23:39 +0800 |
commit | 4201cb7b80c672a72a7448d3de6e0264e2c69a4c (patch) | |
tree | 40577e34e1cde82fceb9683beacb249cc91ed54e /dex/governance.go | |
parent | 3034bbc6b843ca077a585131d62413a55f43dcda (diff) | |
download | go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar.gz go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar.bz2 go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar.lz go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar.xz go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.tar.zst go-tangerine-4201cb7b80c672a72a7448d3de6e0264e2c69a4c.zip |
dex: fix DKGMasterPublicKey and DKGComplaints unmarshal
Diffstat (limited to 'dex/governance.go')
-rw-r--r-- | dex/governance.go | 5 |
1 files 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) |