diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-08 14:34:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 14:34:52 +0800 |
commit | 5c77127c863beff906eddbb285ba99b8af83eab0 (patch) | |
tree | fde89a2fd17a2963bf4b21af55b4c2357cbef030 | |
parent | 9d56c7175ed6ae2e97a161d950764efc60123963 (diff) | |
download | dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar.gz dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar.bz2 dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar.lz dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar.xz dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.tar.zst dexon-consensus-5c77127c863beff906eddbb285ba99b8af83eab0.zip |
core/utils: fix verifyDKGComplaint bug (#472)
* core/utils: fix verifydkgcomplaint bug
* fix test
-rw-r--r-- | core/utils/utils.go | 2 | ||||
-rw-r--r-- | core/utils/utils_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/utils/utils.go b/core/utils/utils.go index 203f57f..220240c 100644 --- a/core/utils/utils.go +++ b/core/utils/utils.go @@ -98,7 +98,7 @@ func VerifyDKGComplaint( if err != nil { return false, err } - return ok, nil + return !ok, nil } // LaunchDummyReceiver launches a go routine to receive from the receive diff --git a/core/utils/utils_test.go b/core/utils/utils_test.go index 88576b8..70f6e98 100644 --- a/core/utils/utils_test.go +++ b/core/utils/utils_test.go @@ -83,7 +83,7 @@ func (s *UtilsTestSuite) TestVerifyDKGComplaint() { signComplaint(prv2, complaint) ok, err = VerifyDKGComplaint(complaint, mpk) s.Require().NoError(err) - s.True(ok) + s.False(ok) // Incorrect privateShare. share, exist = prvShares.Share(typesDKG.NewID(nID1)) @@ -95,7 +95,7 @@ func (s *UtilsTestSuite) TestVerifyDKGComplaint() { signComplaint(prv2, complaint) ok, err = VerifyDKGComplaint(complaint, mpk) s.Require().NoError(err) - s.False(ok) + s.True(ok) // MPK is incorrect. mpk.Round++ |