diff --git a/crates/core/src/checkpoint.rs b/crates/core/src/checkpoint.rs index 9bfdf2eed..e5a5567ea 100644 --- a/crates/core/src/checkpoint.rs +++ b/crates/core/src/checkpoint.rs @@ -10,10 +10,12 @@ use crate::BlockId; /// Checkpoints are cheaply cloneable and are useful to find the agreement point between two sparse /// block chains. #[derive(Debug, Clone)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct CheckPoint(Arc); /// The internal contents of [`CheckPoint`]. #[derive(Debug, Clone)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] struct CPInner { /// Block id (hash and height). block: BlockId, diff --git a/crates/core/src/spk_client.rs b/crates/core/src/spk_client.rs index b6a8e0204..1cbfca6b3 100644 --- a/crates/core/src/spk_client.rs +++ b/crates/core/src/spk_client.rs @@ -387,14 +387,14 @@ impl SyncRequest { /// See also [`SyncRequest`]. #[must_use] #[derive(Debug)] -pub struct SyncResponse { +pub struct SyncResponse { /// Relevant transaction data discovered during the scan. pub tx_update: crate::TxUpdate, /// Changes to the chain discovered during the scan. pub chain_update: Option, } -impl Default for SyncResponse { +impl Default for SyncResponse { fn default() -> Self { Self { tx_update: Default::default(), @@ -540,7 +540,7 @@ impl FullScanRequest { /// See also [`FullScanRequest`]. #[must_use] #[derive(Debug)] -pub struct FullScanResponse { +pub struct FullScanResponse { /// Relevant transaction data discovered during the scan. pub tx_update: crate::TxUpdate, /// Last active indices for the corresponding keychains (`K`). An index is active if it had a @@ -550,7 +550,7 @@ pub struct FullScanResponse { pub chain_update: Option, } -impl Default for FullScanResponse { +impl Default for FullScanResponse { fn default() -> Self { Self { tx_update: Default::default(), diff --git a/crates/core/src/tx_update.rs b/crates/core/src/tx_update.rs index 89a224fbd..b07b20d47 100644 --- a/crates/core/src/tx_update.rs +++ b/crates/core/src/tx_update.rs @@ -19,8 +19,9 @@ use bitcoin::{OutPoint, Transaction, TxOut, Txid}; /// tx_update.anchors.insert((anchor, txid)); /// ``` #[derive(Debug, Clone)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[non_exhaustive] -pub struct TxUpdate { +pub struct TxUpdate { /// Full transactions. These are transactions that were determined to be relevant to the wallet /// given the request. pub txs: Vec>, @@ -52,7 +53,7 @@ pub struct TxUpdate { pub evicted_ats: HashSet<(Txid, u64)>, } -impl Default for TxUpdate { +impl Default for TxUpdate { fn default() -> Self { Self { txs: Default::default(),