@@ -1268,19 +1268,32 @@ impl<A: Anchor> TxGraph<A> {
1268
1268
/// # Example
1269
1269
///
1270
1270
/// ```
1271
- /// use bdk_chain::{tx_graph::TxGraph, BlockId, CanonicalizationParams};
1272
1271
/// use bdk_chain::local_chain::LocalChain;
1273
- /// use bitcoin::{OutPoint, TxOut, Amount};
1272
+ /// use bdk_chain::{tx_graph::TxGraph, BlockId, CanonicalizationParams};
1273
+ /// use bitcoin::{Amount, OutPoint, TxOut};
1274
1274
/// use std::sync::Arc;
1275
1275
///
1276
1276
/// let mut graph = TxGraph::<BlockId>::default();
1277
- /// let chain = LocalChain::from_blocks([
1278
- /// (0, bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash())
1279
- /// ].into_iter().collect()).unwrap();
1277
+ /// let chain = LocalChain::from_blocks(
1278
+ /// [(
1279
+ /// 0,
1280
+ /// bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash(),
1281
+ /// )]
1282
+ /// .into_iter()
1283
+ /// .collect(),
1284
+ /// )
1285
+ /// .unwrap();
1280
1286
///
1281
1287
/// // Get unspent outputs
1282
1288
/// let outpoints = vec![(0, OutPoint::default())];
1283
- /// let utxos: Vec<_> = graph.filter_chain_unspents(&chain, chain.tip().block_id(), CanonicalizationParams::default(), outpoints).collect();
1289
+ /// let utxos: Vec<_> = graph
1290
+ /// .filter_chain_unspents(
1291
+ /// &chain,
1292
+ /// chain.tip().block_id(),
1293
+ /// CanonicalizationParams::default(),
1294
+ /// outpoints,
1295
+ /// )
1296
+ /// .collect();
1284
1297
/// ```
1285
1298
///
1286
1299
/// [`try_filter_chain_unspents`]: Self::try_filter_chain_unspents
@@ -1354,17 +1367,29 @@ impl<A: Anchor> TxGraph<A> {
1354
1367
/// # Example
1355
1368
///
1356
1369
/// ```
1357
- /// use bdk_chain::{tx_graph::TxGraph, Balance, BlockId, CanonicalizationParams};
1358
1370
/// use bdk_chain::local_chain::LocalChain;
1371
+ /// use bdk_chain::{tx_graph::TxGraph, Balance, BlockId, CanonicalizationParams};
1359
1372
/// use bitcoin::OutPoint;
1360
1373
///
1361
1374
/// let graph = TxGraph::<BlockId>::default();
1362
- /// let chain = LocalChain::from_blocks([
1363
- /// (0, bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash())
1364
- /// ].into_iter().collect()).unwrap();
1375
+ /// let chain = LocalChain::from_blocks(
1376
+ /// [(
1377
+ /// 0,
1378
+ /// bitcoin::constants::genesis_block(bitcoin::Network::Bitcoin).block_hash(),
1379
+ /// )]
1380
+ /// .into_iter()
1381
+ /// .collect(),
1382
+ /// )
1383
+ /// .unwrap();
1365
1384
///
1366
1385
/// let outpoints = vec![(0, OutPoint::default())];
1367
- /// let balance = graph.balance(&chain, chain.tip().block_id(), CanonicalizationParams::default(), outpoints, |_, _| true);
1386
+ /// let balance = graph.balance(
1387
+ /// &chain,
1388
+ /// chain.tip().block_id(),
1389
+ /// CanonicalizationParams::default(),
1390
+ /// outpoints,
1391
+ /// |_, _| true,
1392
+ /// );
1368
1393
/// ```
1369
1394
///
1370
1395
/// [`try_balance`]: Self::try_balance
0 commit comments