diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-04 12:15:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-04 12:15:06 +0800 |
commit | 0475adf7692697df91d359d67f7298574adfe327 (patch) | |
tree | 7c1dae7d4e8690ecd2b2097233bd534db0fb93ca /core/types/dkg | |
parent | ab2d2d131cadb28a59b51dc5d1142ef8845e2f88 (diff) | |
download | dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar.gz dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar.bz2 dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar.lz dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar.xz dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.tar.zst dexon-consensus-0475adf7692697df91d359d67f7298574adfe327.zip |
core/crypto/dkg: concurrent access for gpk (#548)
* core/crypto/dkg: add benchmark
* core/crypto/dkg: concurrent access for gpk
Diffstat (limited to 'core/types/dkg')
-rw-r--r-- | core/types/dkg/dkg.go | 2 | ||||
-rw-r--r-- | core/types/dkg/dkg_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/types/dkg/dkg.go b/core/types/dkg/dkg.go index e9b22bc..868f0da 100644 --- a/core/types/dkg/dkg.go +++ b/core/types/dkg/dkg.go @@ -130,7 +130,7 @@ func (d *MasterPublicKey) DecodeRLP(s *rlp.Stream) error { Round: dec.Round, Reset: dec.Reset, DKGID: id, - PublicKeyShares: *dec.PublicKeyShares, + PublicKeyShares: *dec.PublicKeyShares.Move(), Signature: dec.Signature, } return err diff --git a/core/types/dkg/dkg_test.go b/core/types/dkg/dkg_test.go index ec16a2b..9f50feb 100644 --- a/core/types/dkg/dkg_test.go +++ b/core/types/dkg/dkg_test.go @@ -63,7 +63,7 @@ func (s *DKGTestSuite) TestRLPEncodeDecode() { Round: 10, Reset: 11, DKGID: dID, - PublicKeyShares: *pubShare, + PublicKeyShares: *pubShare.Clone(), Signature: crypto.Signature{ Type: "123", Signature: []byte{4, 5, 6}, @@ -189,7 +189,7 @@ func (s *DKGTestSuite) TestMasterPublicKeyEquality() { pubKey := prvKey.PublicKey().(cryptoDKG.PublicKey) _, pubShares := cryptoDKG.NewPrivateKeyShares(2) req.NoError(pubShares.AddShare(s.genID(), &pubKey)) - master1.PublicKeyShares = *pubShares + master1.PublicKeyShares = *pubShares.Move() // Prepare another master public key by copying every field. master2 := &MasterPublicKey{} s.clone(master1, master2) |