crypto: API modifications (#5236)

## Description

This PR aims to make the crypto.PubKey interface more intuitive. 

Changes: 

- `VerfiyBytes` -> `VerifySignature`

Before `Bytes()` was amino encoded, now since it is the byte representation should we get rid of it entirely?

EDIT: decided to keep `Bytes()` as it is useful if you are using the interface instead of the concrete key

Closes: #XXX
This commit is contained in:
Marko
2020-08-13 14:29:16 +02:00
committed by GitHub
parent e1a1395cf4
commit 9e98c74e3c
21 changed files with 44 additions and 41 deletions

View File

@@ -247,7 +247,7 @@ func (th *TestHarness) TestSignProposal() error {
return err
}
// now validate the signature on the proposal
if sck.VerifyBytes(propBytes, prop.Signature) {
if sck.VerifySignature(propBytes, prop.Signature) {
th.logger.Info("Successfully validated proposal signature")
} else {
th.logger.Error("FAILED: Proposal signature validation failed")
@@ -298,7 +298,7 @@ func (th *TestHarness) TestSignVote() error {
}
// now validate the signature on the proposal
if sck.VerifyBytes(voteBytes, vote.Signature) {
if sck.VerifySignature(voteBytes, vote.Signature) {
th.logger.Info("Successfully validated vote signature", "type", voteType)
} else {
th.logger.Error("FAILED: Vote signature validation failed", "type", voteType)