diff --git a/Cargo.lock b/Cargo.lock index 32b3c5fd51..0c5f9f58e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2232,6 +2232,7 @@ dependencies = [ "bdk", "bdk-ext", "conquer-once", + "derivative", "hex", "itertools", "libp2p-core", diff --git a/model/Cargo.toml b/model/Cargo.toml index 8bd3025561..d606092188 100644 --- a/model/Cargo.toml +++ b/model/Cargo.toml @@ -9,6 +9,7 @@ async-trait = "0.1" bdk = { version = "0.19.0", default-features = false } bdk-ext = { path = "../bdk-ext" } conquer-once = "0.3" +derivative = "2" hex = "0.4" itertools = "0.10" libp2p-core = { version = "0.33", default-features = false, features = ["serde"] } diff --git a/model/src/olivia.rs b/model/src/olivia.rs index e572913c1c..ed6afeecb6 100644 --- a/model/src/olivia.rs +++ b/model/src/olivia.rs @@ -1,6 +1,7 @@ use anyhow::Context; use bdk::bitcoin::XOnlyPublicKey; use conquer_once::Lazy; +use derivative::Derivative; use maia_core::secp256k1_zkp::SecretKey; use serde::Deserialize; use serde_with::DeserializeFromStr; @@ -45,12 +46,17 @@ pub struct Attestation { pub scalars: Vec, } -#[derive( - Debug, Clone, Copy, SerializeDisplay, DeserializeFromStr, PartialEq, Eq, Hash, PartialOrd, Ord, -)] +#[derive(Derivative, Debug, Clone, Copy, SerializeDisplay, DeserializeFromStr)] +#[derivative(PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct BitMexPriceEventId { /// The timestamp this price event refers to. timestamp: OffsetDateTime, + #[derivative( + PartialEq = "ignore", + PartialOrd = "ignore", + Ord = "ignore", + Hash = "ignore" + )] digits: usize, }