Skip to content

Commit f679260

Browse files
committed
commit: fix tests with new verify APIs
1 parent b83ef01 commit f679260

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

commit_verify/src/embed.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,18 @@ pub(crate) mod test_helpers {
197197
});
198198

199199
// Testing verification
200-
assert!(commitment.clone().verify(msg, &proof).unwrap());
200+
assert!(commitment.clone().verify(msg, &proof));
201201

202202
messages.iter().for_each(|m| {
203203
// Testing that commitment verification succeeds only
204204
// for the original message and fails for the rest
205-
assert_eq!(commitment.clone().verify(m, &proof).unwrap(), m == msg);
205+
assert_eq!(commitment.clone().verify(m, &proof), m == msg);
206206
});
207207

208208
acc.iter().for_each(|cmt| {
209209
// Testing that verification against other commitments
210210
// returns `false`
211-
assert!(!cmt.clone().verify(msg, &proof).unwrap());
211+
assert!(!cmt.clone().verify(msg, &proof));
212212
});
213213

214214
// Detecting collision: each message should produce a unique
@@ -243,18 +243,18 @@ pub(crate) mod test_helpers {
243243
});
244244

245245
// Testing verification
246-
assert!(SUPPLEMENT.verify(msg, &commitment).unwrap());
246+
assert!(SUPPLEMENT.verify(msg, &commitment));
247247

248248
messages.iter().for_each(|m| {
249249
// Testing that commitment verification succeeds only
250250
// for the original message and fails for the rest
251-
assert_eq!(SUPPLEMENT.verify(m, &commitment).unwrap(), m == msg);
251+
assert_eq!(SUPPLEMENT.verify(m, &commitment), m == msg);
252252
});
253253

254254
acc.iter().for_each(|commitment| {
255255
// Testing that verification against other commitments
256256
// returns `false`
257-
assert!(!SUPPLEMENT.verify(msg, commitment).unwrap());
257+
assert!(!SUPPLEMENT.verify(msg, commitment));
258258
});
259259

260260
// Detecting collision: each message should produce a unique
@@ -293,8 +293,8 @@ mod test {
293293
impl<T> EmbedCommitProof<T, DummyVec, TestProtocol> for DummyProof
294294
where T: AsRef<[u8]> + Clone + CommitEncode
295295
{
296-
fn restore_original_container(&self, _: &DummyVec) -> Result<DummyVec, Error> {
297-
Ok(DummyVec(self.0.clone()))
296+
fn restore_original_container(&self, _: &DummyVec) -> Option<DummyVec> {
297+
Some(DummyVec(self.0.clone()))
298298
}
299299
}
300300

@@ -303,7 +303,6 @@ mod test {
303303
{
304304
type Proof = DummyProof;
305305
type CommitError = Error;
306-
type VerifyError = Error;
307306

308307
fn embed_commit(&mut self, msg: &T) -> Result<Self::Proof, Self::CommitError> {
309308
let proof = self.0.clone();

0 commit comments

Comments
 (0)