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 Volf
2020-03-24 10:05:57 -07:00
committed by GitHub
parent 6beb6acbd5
commit 27fe4206ed
5 changed files with 81 additions and 19 deletions
+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)
}