@@ -659,10 +659,10 @@ impl<A: Anchor> TxGraph<A> {
659
659
/// # Example
660
660
///
661
661
/// ```
662
- /// use bdk_chain::tx_graph::TxGraph;
662
+ /// use bdk_chain::{ tx_graph::TxGraph, BlockId} ;
663
663
/// use bitcoin::Transaction;
664
664
///
665
- /// let mut graph = TxGraph::<() >::default();
665
+ /// let mut graph = TxGraph::<BlockId >::default();
666
666
/// let tx = Transaction {
667
667
/// version: bitcoin::transaction::Version::ONE,
668
668
/// lock_time: bitcoin::locktime::absolute::LockTime::ZERO,
@@ -1275,12 +1275,12 @@ impl<A: Anchor> TxGraph<A> {
1275
1275
///
1276
1276
/// let mut graph = TxGraph::<BlockId>::default();
1277
1277
/// let chain = LocalChain::from_blocks([
1278
- /// (0, BlockId { height: 0, hash: bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash() } )
1279
- /// ].into_iter().collect());
1278
+ /// (0, bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash())
1279
+ /// ].into_iter().collect()).unwrap() ;
1280
1280
///
1281
1281
/// // Get unspent outputs
1282
1282
/// let outpoints = vec![(0, OutPoint::default())];
1283
- /// let utxos: Vec<_> = graph.filter_chain_unspents(&chain, chain.tip(), CanonicalizationParams::default(), outpoints).collect();
1283
+ /// let utxos: Vec<_> = graph.filter_chain_unspents(&chain, chain.tip().block_id() , CanonicalizationParams::default(), outpoints).collect();
1284
1284
/// ```
1285
1285
///
1286
1286
/// [`try_filter_chain_unspents`]: Self::try_filter_chain_unspents
@@ -1360,11 +1360,11 @@ impl<A: Anchor> TxGraph<A> {
1360
1360
///
1361
1361
/// let graph = TxGraph::<BlockId>::default();
1362
1362
/// let chain = LocalChain::from_blocks([
1363
- /// (0, BlockId { height: 0, hash: bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash() } )
1364
- /// ].into_iter().collect());
1365
- ///
1363
+ /// (0, bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash())
1364
+ /// ].into_iter().collect()).unwrap() ;
1365
+ ///
1366
1366
/// let outpoints = vec![(0, OutPoint::default())];
1367
- /// let balance = graph.balance(&chain, chain.tip(), CanonicalizationParams::default(), outpoints, |_, _| true);
1367
+ /// let balance = graph.balance(&chain, chain.tip().block_id() , CanonicalizationParams::default(), outpoints, |_, _| true);
1368
1368
/// ```
1369
1369
///
1370
1370
/// [`try_balance`]: Self::try_balance
0 commit comments