Skip to content

Commit

Permalink
Merge branch 'tiago/call-msg-parse' (#1849)
Browse files Browse the repository at this point in the history
* origin/tiago/call-msg-parse:
  Changelog for #1849
  Call `Message::parse` directly
  • Loading branch information
Fraccaman committed Sep 6, 2023
2 parents 43584ed + 3f0ad72 commit a45bf7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/1849-call-msg-parse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Call `Message::parse` directly
([\#1849](https://github.com/anoma/namada/pull/1849))
7 changes: 2 additions & 5 deletions core/src/types/key/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,7 @@ impl super::SigScheme for SigScheme {
#[cfg(any(test, feature = "secp256k1-sign"))]
{
let message =
libsecp256k1::Message::parse_slice(&data.signable_hash::<H>())
.expect("Message encoding should not fail");
libsecp256k1::Message::parse(&data.signable_hash::<H>());
let (sig, recovery_id) = libsecp256k1::sign(&message, &keypair.0);
Signature(sig, recovery_id)
}
Expand All @@ -605,9 +604,7 @@ impl super::SigScheme for SigScheme {
where
H: 'static + StorageHasher,
{
let message =
libsecp256k1::Message::parse_slice(&data.signable_hash::<H>())
.expect("Message encoding should not fail");
let message = libsecp256k1::Message::parse(&data.signable_hash::<H>());
let is_valid = libsecp256k1::verify(&message, &sig.0, &pk.0);
if is_valid {
Ok(())
Expand Down

0 comments on commit a45bf7f

Please sign in to comment.