@@ -21,7 +21,7 @@ use bitcoincore_rpc::RpcApi;
21
21
pub fn test_sync_local_chain ( ) -> anyhow:: Result < ( ) > {
22
22
let env = TestEnv :: new ( ) ?;
23
23
let network_tip = env. rpc_client ( ) . get_block_count ( ) ?;
24
- let ( mut local_chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
24
+ let ( mut local_chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
25
25
let mut emitter = Emitter :: new (
26
26
env. rpc_client ( ) ,
27
27
local_chain. tip ( ) ,
@@ -152,7 +152,7 @@ fn test_into_tx_graph() -> anyhow::Result<()> {
152
152
153
153
env. mine_blocks ( 101 , None ) ?;
154
154
155
- let ( mut chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
155
+ let ( mut chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
156
156
let mut indexed_tx_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
157
157
let mut index = SpkTxOutIndex :: < usize > :: default ( ) ;
158
158
index. insert_spk ( 0 , addr_0. script_pubkey ( ) ) ;
@@ -252,10 +252,7 @@ fn ensure_block_emitted_after_reorg_is_at_reorg_height() -> anyhow::Result<()> {
252
252
let env = TestEnv :: new ( ) ?;
253
253
let mut emitter = Emitter :: new (
254
254
env. rpc_client ( ) ,
255
- CheckPoint :: new ( BlockId {
256
- height : 0 ,
257
- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
258
- } ) ,
255
+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
259
256
EMITTER_START_HEIGHT as _ ,
260
257
NO_EXPECTED_MEMPOOL_TXS ,
261
258
) ;
@@ -286,7 +283,7 @@ fn process_block(
286
283
block : Block ,
287
284
block_height : u32 ,
288
285
) -> anyhow:: Result < ( ) > {
289
- recv_chain. apply_update ( CheckPoint :: from_header ( & block. header , block_height) ) ?;
286
+ recv_chain. apply_header ( & block. header , block_height) ?;
290
287
let _ = recv_graph. apply_block ( block, block_height) ;
291
288
Ok ( ( ) )
292
289
}
@@ -334,10 +331,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
334
331
let env = TestEnv :: new ( ) ?;
335
332
let mut emitter = Emitter :: new (
336
333
env. rpc_client ( ) ,
337
- CheckPoint :: new ( BlockId {
338
- height : 0 ,
339
- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
340
- } ) ,
334
+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
341
335
0 ,
342
336
NO_EXPECTED_MEMPOOL_TXS ,
343
337
) ;
@@ -351,7 +345,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
351
345
let addr_to_track = Address :: from_script ( & spk_to_track, Network :: Regtest ) ?;
352
346
353
347
// setup receiver
354
- let ( mut recv_chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
348
+ let ( mut recv_chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
355
349
let mut recv_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
356
350
let mut recv_index = SpkTxOutIndex :: default ( ) ;
357
351
recv_index. insert_spk ( ( ) , spk_to_track. clone ( ) ) ;
@@ -425,10 +419,7 @@ fn mempool_avoids_re_emission() -> anyhow::Result<()> {
425
419
let env = TestEnv :: new ( ) ?;
426
420
let mut emitter = Emitter :: new (
427
421
env. rpc_client ( ) ,
428
- CheckPoint :: new ( BlockId {
429
- height : 0 ,
430
- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
431
- } ) ,
422
+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
432
423
0 ,
433
424
NO_EXPECTED_MEMPOOL_TXS ,
434
425
) ;
@@ -498,10 +489,7 @@ fn no_agreement_point() -> anyhow::Result<()> {
498
489
// start height is 99
499
490
let mut emitter = Emitter :: new (
500
491
env. rpc_client ( ) ,
501
- CheckPoint :: new ( BlockId {
502
- height : 0 ,
503
- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
504
- } ) ,
492
+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
505
493
( PREMINE_COUNT - 2 ) as u32 ,
506
494
NO_EXPECTED_MEMPOOL_TXS ,
507
495
) ;
@@ -573,7 +561,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
573
561
. 0 ;
574
562
let spk = desc. at_derivation_index ( 0 ) ?. script_pubkey ( ) ;
575
563
576
- let mut chain = LocalChain :: from_genesis_hash ( genesis_block ( Network :: Regtest ) . block_hash ( ) ) . 0 ;
564
+ let mut chain = LocalChain :: from_genesis ( genesis_block ( Network :: Regtest ) . block_hash ( ) ) . 0 ;
577
565
let chain_tip = chain. tip ( ) . block_id ( ) ;
578
566
579
567
let mut index = SpkTxOutIndex :: default ( ) ;
@@ -594,7 +582,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
594
582
let mut emitter = Emitter :: new ( env. rpc_client ( ) , chain. tip ( ) , 1 , core:: iter:: once ( tx_1) ) ;
595
583
while let Some ( emission) = emitter. next_block ( ) ? {
596
584
let height = emission. block_height ( ) ;
597
- chain. apply_update ( CheckPoint :: from_header ( & emission. block . header , height) ) ?;
585
+ chain. apply_header ( & emission. block . header , height) ?;
598
586
}
599
587
600
588
let changeset = graph. batch_insert_unconfirmed ( emitter. mempool ( ) ?. update ) ;
@@ -670,10 +658,7 @@ fn detect_new_mempool_txs() -> anyhow::Result<()> {
670
658
671
659
let mut emitter = Emitter :: new (
672
660
env. rpc_client ( ) ,
673
- CheckPoint :: new ( BlockId {
674
- height : 0 ,
675
- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
676
- } ) ,
661
+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
677
662
0 ,
678
663
NO_EXPECTED_MEMPOOL_TXS ,
679
664
) ;
0 commit comments