aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-22 12:54:03 +0800
committerGitHub <noreply@github.com>2018-12-22 12:54:03 +0800
commit6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6 (patch)
tree1895248f011a356fcd2a28c03dbda9d93fd46fd8 /core/utils.go
parent146ed32cf841151b826eafd7d6ade188c56865bf (diff)
downloaddexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.gz
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.bz2
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.lz
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.xz
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.zst
dexon-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.zip
utils: move authenticator to utils package (#378)
Diffstat (limited to 'core/utils.go')
-rw-r--r--core/utils.go23
1 files changed, 1 insertions, 22 deletions
diff --git a/core/utils.go b/core/utils.go
index 671d680..838369c 100644
--- a/core/utils.go
+++ b/core/utils.go
@@ -146,27 +146,6 @@ func HashConfigurationBlock(
)
}
-// VerifyBlock verifies the signature of types.Block.
-func VerifyBlock(b *types.Block) (err error) {
- hash, err := hashBlock(b)
- if err != nil {
- return
- }
- if hash != b.Hash {
- err = ErrIncorrectHash
- return
- }
- pubKey, err := crypto.SigToPub(b.Hash, b.Signature)
- if err != nil {
- return
- }
- if !b.ProposerID.Equal(types.NewNodeID(pubKey)) {
- err = ErrIncorrectSignature
- return
- }
- return
-}
-
// VerifyAgreementResult perform sanity check against a types.AgreementResult
// instance.
func VerifyAgreementResult(
@@ -201,7 +180,7 @@ func VerifyAgreementResult(
if _, exist := notarySet[vote.ProposerID]; !exist {
return ErrIncorrectVoteProposer
}
- ok, err := verifyVoteSignature(&vote)
+ ok, err := utils.VerifyVoteSignature(&vote)
if err != nil {
return err
}