@@ -21,7 +21,7 @@ use bitcoincore_rpc::RpcApi;
2121pub fn test_sync_local_chain ( ) -> anyhow:: Result < ( ) > {
2222 let env = TestEnv :: new ( ) ?;
2323 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 ) ?) ;
2525 let mut emitter = Emitter :: new (
2626 env. rpc_client ( ) ,
2727 local_chain. tip ( ) ,
@@ -152,7 +152,7 @@ fn test_into_tx_graph() -> anyhow::Result<()> {
152152
153153 env. mine_blocks ( 101 , None ) ?;
154154
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 ) ?) ;
156156 let mut indexed_tx_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
157157 let mut index = SpkTxOutIndex :: < usize > :: default ( ) ;
158158 index. insert_spk ( 0 , addr_0. script_pubkey ( ) ) ;
@@ -252,10 +252,7 @@ fn ensure_block_emitted_after_reorg_is_at_reorg_height() -> anyhow::Result<()> {
252252 let env = TestEnv :: new ( ) ?;
253253 let mut emitter = Emitter :: new (
254254 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 ) ?) ,
259256 EMITTER_START_HEIGHT as _ ,
260257 NO_EXPECTED_MEMPOOL_TXS ,
261258 ) ;
@@ -286,7 +283,7 @@ fn process_block(
286283 block : Block ,
287284 block_height : u32 ,
288285) -> anyhow:: Result < ( ) > {
289- recv_chain. apply_update ( CheckPoint :: from_header ( & block. header , block_height) ) ?;
286+ recv_chain. apply_header ( & block. header , block_height) ?;
290287 let _ = recv_graph. apply_block ( block, block_height) ;
291288 Ok ( ( ) )
292289}
@@ -334,10 +331,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
334331 let env = TestEnv :: new ( ) ?;
335332 let mut emitter = Emitter :: new (
336333 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 ) ?) ,
341335 0 ,
342336 NO_EXPECTED_MEMPOOL_TXS ,
343337 ) ;
@@ -351,7 +345,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
351345 let addr_to_track = Address :: from_script ( & spk_to_track, Network :: Regtest ) ?;
352346
353347 // 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 ) ?) ;
355349 let mut recv_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
356350 let mut recv_index = SpkTxOutIndex :: default ( ) ;
357351 recv_index. insert_spk ( ( ) , spk_to_track. clone ( ) ) ;
@@ -425,10 +419,7 @@ fn mempool_avoids_re_emission() -> anyhow::Result<()> {
425419 let env = TestEnv :: new ( ) ?;
426420 let mut emitter = Emitter :: new (
427421 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 ) ?) ,
432423 0 ,
433424 NO_EXPECTED_MEMPOOL_TXS ,
434425 ) ;
@@ -498,10 +489,7 @@ fn no_agreement_point() -> anyhow::Result<()> {
498489 // start height is 99
499490 let mut emitter = Emitter :: new (
500491 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 ) ?) ,
505493 ( PREMINE_COUNT - 2 ) as u32 ,
506494 NO_EXPECTED_MEMPOOL_TXS ,
507495 ) ;
@@ -573,7 +561,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
573561 . 0 ;
574562 let spk = desc. at_derivation_index ( 0 ) ?. script_pubkey ( ) ;
575563
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 ;
577565 let chain_tip = chain. tip ( ) . block_id ( ) ;
578566
579567 let mut index = SpkTxOutIndex :: default ( ) ;
@@ -594,7 +582,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
594582 let mut emitter = Emitter :: new ( env. rpc_client ( ) , chain. tip ( ) , 1 , core:: iter:: once ( tx_1) ) ;
595583 while let Some ( emission) = emitter. next_block ( ) ? {
596584 let height = emission. block_height ( ) ;
597- chain. apply_update ( CheckPoint :: from_header ( & emission. block . header , height) ) ?;
585+ chain. apply_header ( & emission. block . header , height) ?;
598586 }
599587
600588 let changeset = graph. batch_insert_unconfirmed ( emitter. mempool ( ) ?. update ) ;
@@ -670,10 +658,7 @@ fn detect_new_mempool_txs() -> anyhow::Result<()> {
670658
671659 let mut emitter = Emitter :: new (
672660 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 ) ?) ,
677662 0 ,
678663 NO_EXPECTED_MEMPOOL_TXS ,
679664 ) ;
0 commit comments