mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Add PartialEq to structs
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::{Curve, FrostError, MultisigView};
|
||||
pub trait Algorithm<C: Curve>: Clone {
|
||||
type Transcript: Transcript + Clone + Debug;
|
||||
/// The resulting type of the signatures this algorithm will produce
|
||||
type Signature: Clone + Debug;
|
||||
type Signature: Clone + PartialEq + Debug;
|
||||
|
||||
fn transcript(&mut self) -> &mut Self::Transcript;
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ impl fmt::Display for State {
|
||||
}
|
||||
|
||||
pub trait StateMachine {
|
||||
type Signature;
|
||||
type Signature: Clone + PartialEq + fmt::Debug;
|
||||
|
||||
/// Perform the preprocessing round required in order to sign
|
||||
/// Returns a byte vector which must be transmitted to all parties selected for this signing
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user