aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-08 14:35:11 +0800
committerGitHub <noreply@github.com>2019-03-08 14:35:11 +0800
commit29a5e39cde95b1a4e3716a2152d9298303c80f60 (patch)
tree5b90415e7f2b3396a97bd4de9682f04fecd31e86
parentceeb8ee33967e370ab96213850546d32c3c20951 (diff)
downloaddexon-consensus-29a5e39cde95b1a4e3716a2152d9298303c80f60.tar.gz
dexon-consensus-29a5e39cde95b1a4e3716a2152d9298303c80f60.tar.zst
dexon-consensus-29a5e39cde95b1a4e3716a2152d9298303c80f60.zip
core/utils: fix verifyDKGComplaint bug (#473)
* core/utils: fix verifydkgcomplaint bug * fix test
-rw-r--r--core/utils/utils.go2
-rw-r--r--core/utils/utils_test.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/utils/utils.go b/core/utils/utils.go
index 8486d28..7d901be 100644
--- a/core/utils/utils.go
+++ b/core/utils/utils.go
@@ -91,7 +91,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++