Update schnorrkel with versioning (#5358)

* use versioning for deprecated api, remove deprecated api from regular verification

* Update primitives/core/src/sr25519.rs

* add test to transaction pool

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Nikolay VolfandBastian Köcher authored and GitHub committed 2020-03-24 18:05:57 +01:00
1 parent 6beb6acbd5
commit 27fe4206ed
5 files changed
+81 -19

No files matched your search

+9
View File
@@ -466,9 +466,18 @@ pub trait Crypto {
.map(|k| k.sign(msg))
}
/// Verify an `sr25519` signature.
///
/// Returns `true` when the verification in successful regardless of
/// signature version.
fn sr25519_verify(sig: &sr25519::Signature, msg: &[u8], pubkey: &sr25519::Public) -> bool {
sr25519::Pair::verify_deprecated(sig, msg, pubkey)
}
/// Verify an `sr25519` signature.
///
/// Returns `true` when the verification in successful.
#[version(2)]
fn sr25519_verify(sig: &sr25519::Signature, msg: &[u8], pubkey: &sr25519::Public) -> bool {
sr25519::Pair::verify(sig, msg, pubkey)
}