@@ -4,9 +4,8 @@ use core::convert::Infallible;
44use core:: fmt;
55use core:: ops:: RangeBounds ;
66
7- use crate :: canonical_task:: CanonicalizationTask ;
87use crate :: collections:: BTreeMap ;
9- use crate :: { Anchor , BlockId , CanonicalView , ChainOracle , Merge } ;
8+ use crate :: { BlockId , ChainOracle , Merge } ;
109use bdk_core:: { ChainQuery , ToBlockHash } ;
1110pub use bdk_core:: { CheckPoint , CheckPointIter } ;
1211use bitcoin:: block:: Header ;
@@ -129,8 +128,8 @@ impl LocalChain<BlockHash> {
129128
130129 /// Canonicalize a transaction graph using this chain.
131130 ///
132- /// This method processes a [`CanonicalizationTask `], handling all its requests
133- /// to determine which transactions are canonical, and returns a [`CanonicalView`] .
131+ /// This method processes any type implementing [`ChainQuery `], handling all its requests
132+ /// to determine which transactions are canonical, and returns the query's output .
134133 ///
135134 /// # Example
136135 ///
@@ -144,10 +143,10 @@ impl LocalChain<BlockHash> {
144143 /// let task = CanonicalizationTask::new(&tx_graph, chain_tip, CanonicalizationParams::default());
145144 /// let view = chain.canonicalize(task);
146145 /// ```
147- pub fn canonicalize < A : Anchor > (
148- & self ,
149- mut task : CanonicalizationTask < ' _ , A > ,
150- ) -> CanonicalView < A > {
146+ pub fn canonicalize < Q > ( & self , mut task : Q ) -> Q :: Output
147+ where
148+ Q : ChainQuery < BlockId > ,
149+ {
151150 // Process all requests from the task
152151 while let Some ( request) = task. next_query ( ) {
153152 let chain_tip = request. chain_tip ;
0 commit comments