Skip to content

Commit

Permalink
assert that all redpallas signatures verify when we benchmark them
Browse files Browse the repository at this point in the history
  • Loading branch information
dconnolly committed Jun 29, 2021
1 parent 5cd8c6f commit 83c4979
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions zebra-chain/benches/redpallas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ fn bench_batch_verify(c: &mut Criterion) {
for item in sigs.iter() {
match item {
Item::SpendAuth { vk_bytes, sig } => {
let _ = VerificationKey::try_from(*vk_bytes)
.and_then(|vk| vk.verify(MESSAGE_BYTES, sig));
assert!(VerificationKey::try_from(*vk_bytes)
.and_then(|vk| vk.verify(MESSAGE_BYTES, sig))
.is_ok());
}
Item::Binding { vk_bytes, sig } => {
let _ = VerificationKey::try_from(*vk_bytes)
.and_then(|vk| vk.verify(MESSAGE_BYTES, sig));
assert!(VerificationKey::try_from(*vk_bytes)
.and_then(|vk| vk.verify(MESSAGE_BYTES, sig))
.is_ok());
}
}
}
Expand All @@ -99,7 +101,7 @@ fn bench_batch_verify(c: &mut Criterion) {
}
}
}
batch.verify(thread_rng())
assert!(batch.verify(thread_rng()).is_ok())
})
},
);
Expand Down

0 comments on commit 83c4979

Please sign in to comment.