Skip to content

Commit bd92253

Browse files
evanlinjinoleonardolima
authored andcommitted
feat(chain)!: Remove CanonicalTx
BREAKING: Remove `CanonicalTx` as it's no longer needed.
1 parent b46dbf8 commit bd92253

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

crates/chain/src/tx_graph.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ use crate::BlockId;
124124
use crate::CanonicalIter;
125125
use crate::CanonicalView;
126126
use crate::CanonicalizationParams;
127-
use crate::{Anchor, ChainOracle, ChainPosition, Merge};
127+
use crate::{Anchor, ChainOracle, Merge};
128128
use alloc::collections::vec_deque::VecDeque;
129129
use alloc::sync::Arc;
130130
use alloc::vec::Vec;
@@ -245,27 +245,6 @@ impl Default for TxNodeInternal {
245245
}
246246
}
247247

248-
/// A transaction that is deemed to be part of the canonical history.
249-
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
250-
pub struct CanonicalTx<'a, T, A> {
251-
/// How the transaction is observed in the canonical chain (confirmed or unconfirmed).
252-
pub chain_position: ChainPosition<A>,
253-
/// The transaction node (as part of the graph).
254-
pub tx_node: TxNode<'a, T, A>,
255-
}
256-
257-
impl<'a, T, A> From<CanonicalTx<'a, T, A>> for Txid {
258-
fn from(tx: CanonicalTx<'a, T, A>) -> Self {
259-
tx.tx_node.txid
260-
}
261-
}
262-
263-
impl<'a, A> From<CanonicalTx<'a, Arc<Transaction>, A>> for Arc<Transaction> {
264-
fn from(tx: CanonicalTx<'a, Arc<Transaction>, A>) -> Self {
265-
tx.tx_node.tx
266-
}
267-
}
268-
269248
/// Errors returned by `TxGraph::calculate_fee`.
270249
#[derive(Debug, PartialEq, Eq)]
271250
pub enum CalculateFeeError {

0 commit comments

Comments
 (0)