Skip to content

Commit

Permalink
RG: Implementation of Eq for Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 2, 2020
1 parent 4a9217e commit 3db8cd1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rgb/schema/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sha256t_hash_newtype!(
false
);

#[derive(Clone, PartialEq, Debug, Default)]
#[derive(Clone, Debug, Default)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
Expand Down Expand Up @@ -90,6 +90,14 @@ impl CommitEncodeWithStrategy for Schema {
type Strategy = commit_strategy::UsingStrict;
}

impl PartialEq for Schema {
fn eq(&self, other: &Self) -> bool {
self.schema_id() == other.schema_id()
}
}

impl Eq for Schema {}

mod strict_encoding {
use super::*;
use crate::strict_encoding::{
Expand Down

0 comments on commit 3db8cd1

Please sign in to comment.