From beb16a146b774eac3451f0ca0062b4ccee04f6c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BF=97=E5=AE=87?= Date: Thu, 11 Sep 2025 08:30:33 +0000 Subject: [PATCH] feat(chain)!: Remove `CanonicalTx` BREAKING: Remove `CanonicalTx` as it's no longer needed. --- crates/chain/src/tx_graph.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 3416f0df..01281029 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -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, - /// The transaction node (as part of the graph). - pub tx_node: TxNode<'a, T, A>, -} - -impl<'a, T, A> From> for Txid { - fn from(tx: CanonicalTx<'a, T, A>) -> Self { - tx.tx_node.txid - } -} - -impl<'a, A> From, A>> for Arc { - fn from(tx: CanonicalTx<'a, Arc, A>) -> Self { - tx.tx_node.tx - } -} - /// Errors returned by `TxGraph::calculate_fee`. #[derive(Debug, PartialEq, Eq)] pub enum CalculateFeeError { -- 2.49.0