Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jan 23, 2024
1 parent aa6286c commit 6197419
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/crypto/tests/wycheproof_secp256k1.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::single_match)]

use cosmwasm_crypto::secp256k1_verify;
use serde::Deserialize;

Expand Down Expand Up @@ -112,7 +114,7 @@ fn ecdsa_secp256k1_sha256() {
if let Ok(signature) = from_der(&der_signature) {
match secp256k1_verify(&message_hash, &signature, &public_key) {
Ok(valid) => assert!(!valid),
Err(_) => {}
Err(_) => { /* this is expected for "invalid", all good */ }
}
} else {
// invalid DER encoding, okay
Expand Down Expand Up @@ -161,7 +163,7 @@ fn ecdsa_secp256k1_sha512() {
if let Ok(signature) = from_der(&der_signature) {
match secp256k1_verify(&message_hash, &signature, &public_key) {
Ok(valid) => assert!(!valid),
Err(_) => {}
Err(_) => { /* this is expected for "invalid", all good */ }
}
} else {
// invalid DER encoding, okay
Expand Down Expand Up @@ -210,7 +212,7 @@ fn ecdsa_secp256k1_sha3_256() {
if let Ok(signature) = from_der(&der_signature) {
match secp256k1_verify(&message_hash, &signature, &public_key) {
Ok(valid) => assert!(!valid),
Err(_) => {}
Err(_) => { /* this is expected for "invalid", all good */ }
}
} else {
// invalid DER encoding, okay
Expand Down Expand Up @@ -259,7 +261,7 @@ fn ecdsa_secp256k1_sha3_512() {
if let Ok(signature) = from_der(&der_signature) {
match secp256k1_verify(&message_hash, &signature, &public_key) {
Ok(valid) => assert!(!valid),
Err(_) => {}
Err(_) => { /* this is expected for "invalid", all good */ }
}
} else {
// invalid DER encoding, okay
Expand Down Expand Up @@ -349,7 +351,7 @@ fn from_der(data: &[u8]) -> Result<[u8; 64], String> {
Ok(out)
}

fn decode_unsigned_integer<'a>(mut data: &'a [u8], name: &str) -> Result<[u8; 32], String> {
fn decode_unsigned_integer(mut data: &[u8], name: &str) -> Result<[u8; 32], String> {
if data.is_empty() {
return Err(format!("{name} data is empty"));
}
Expand Down

0 comments on commit 6197419

Please sign in to comment.