Add PartialEq to structs

This commit is contained in:
Luke Parker
2022-05-25 00:21:01 -04:00
parent d10c6e16dc
commit d67d6f2f98
13 changed files with 28 additions and 25 deletions

View File

@@ -17,6 +17,12 @@ pub trait Transcript {
#[derive(Clone, Debug)]
pub struct DigestTranscript<D: Digest>(Vec<u8>, PhantomData<D>);
impl<D: Digest> PartialEq for DigestTranscript<D> {
fn eq(&self, other: &DigestTranscript<D>) -> bool {
self.0 == other.0
}
}
impl<D: Digest> DigestTranscript<D> {
pub fn new(label: Vec<u8>) -> Self {
DigestTranscript(label, PhantomData)

View File

@@ -2,7 +2,7 @@ use core::{marker::PhantomData, fmt::{Debug, Formatter}};
use digest::Digest;
#[derive(Clone)]
#[derive(Clone, PartialEq)]
pub struct MerlinTranscript(pub merlin::Transcript);
// Merlin doesn't implement Debug so provide a stub which won't panic
impl Debug for MerlinTranscript {