Skip to content

Commit

Permalink
Derive PartialEq, Eq on ProdCommitValidator (#1264)
Browse files Browse the repository at this point in the history
Also add test code that ensures ProdVerifier supports the common derived
traits.
  • Loading branch information
mzabaluev authored Feb 6, 2023
1 parent 47e28b5 commit 89c8add
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion light-client-verifier/src/operations/commit_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub trait CommitValidator: Send + Sync {
}

/// Production-ready implementation of a commit validator.
#[derive(Copy, Clone, Default, Debug)]
#[derive(Copy, Clone, Default, Debug, PartialEq, Eq)]
pub struct ProdCommitValidator;

impl CommitValidator for ProdCommitValidator {}
6 changes: 6 additions & 0 deletions light-client-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ mod tests {
Verdict, Verifier,
};

#[cfg(feature = "rust-crypto")]
#[derive(Clone, Debug, PartialEq, Eq)]
struct ProdVerifierSupportsCommonDerivedTraits {
verifier: ProdVerifier,
}

#[test]
fn test_verification_failure_on_chain_id_mismatch() {
let now = Time::now();
Expand Down

0 comments on commit 89c8add

Please sign in to comment.