]> Untitled Git - bdk/commitdiff
feat(chain)!: Remove `CanonicalTx`
author志宇 <hello@evanlinjin.me>
Thu, 11 Sep 2025 08:30:33 +0000 (08:30 +0000)
committer志宇 <hello@evanlinjin.me>
Wed, 17 Sep 2025 23:46:29 +0000 (23:46 +0000)
BREAKING: Remove `CanonicalTx` as it's no longer needed.

crates/chain/src/tx_graph.rs

index 3416f0df97d8372844f43abd1f3e47943245f51f..012810293820d85d3373218c64384edf9ace2460 100644 (file)
@@ -124,7 +124,7 @@ use crate::BlockId;
 use crate::CanonicalIter;
 use crate::CanonicalView;
 use crate::CanonicalizationParams;
-use crate::{Anchor, ChainOracle, ChainPosition, Merge};
+use crate::{Anchor, ChainOracle, Merge};
 use alloc::collections::vec_deque::VecDeque;
 use alloc::sync::Arc;
 use alloc::vec::Vec;
@@ -245,27 +245,6 @@ impl Default for TxNodeInternal {
     }
 }
 
-/// A transaction that is deemed to be part of the canonical history.
-#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
-pub struct CanonicalTx<'a, T, A> {
-    /// How the transaction is observed in the canonical chain (confirmed or unconfirmed).
-    pub chain_position: ChainPosition<A>,
-    /// The transaction node (as part of the graph).
-    pub tx_node: TxNode<'a, T, A>,
-}
-
-impl<'a, T, A> From<CanonicalTx<'a, T, A>> for Txid {
-    fn from(tx: CanonicalTx<'a, T, A>) -> Self {
-        tx.tx_node.txid
-    }
-}
-
-impl<'a, A> From<CanonicalTx<'a, Arc<Transaction>, A>> for Arc<Transaction> {
-    fn from(tx: CanonicalTx<'a, Arc<Transaction>, A>) -> Self {
-        tx.tx_node.tx
-    }
-}
-
 /// Errors returned by `TxGraph::calculate_fee`.
 #[derive(Debug, PartialEq, Eq)]
 pub enum CalculateFeeError {