sp-beefy: align authority id key type with its signature type (#13131)

Still allows custom message hasher, but ties together the crypto
types used for private+public keys and the signature.

Signed-off-by: acatangiu <adrian@parity.io>
This commit is contained in:
Adrian Catangiu
2023-01-13 14:52:18 +02:00
committed by GitHub
parent b8ebe3dc52
commit 8ac1de8f04
2 changed files with 27 additions and 29 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ use log::warn;
use beefy_primitives::{
crypto::{Public, Signature},
BeefyVerify, KEY_TYPE,
BeefyAuthorityId, KEY_TYPE,
};
use crate::error;
@@ -99,7 +99,7 @@ impl BeefyKeystore {
///
/// Return `true` if the signature is authentic, `false` otherwise.
pub fn verify(public: &Public, sig: &Signature, message: &[u8]) -> bool {
BeefyVerify::<Keccak256>::verify(sig, message, public)
BeefyAuthorityId::<Keccak256>::verify(public, sig, message)
}
}