@@ -24,7 +24,7 @@ use bitcoincore_rpc::RpcApi;
2424pub fn test_sync_local_chain ( ) -> anyhow:: Result < ( ) > {
2525 let env = TestEnv :: new ( ) ?;
2626 let network_tip = env. rpc_client ( ) . get_block_count ( ) ?;
27- let ( mut local_chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
27+ let ( mut local_chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
2828 let mut emitter = Emitter :: new (
2929 env. rpc_client ( ) ,
3030 local_chain. tip ( ) ,
@@ -155,7 +155,7 @@ fn test_into_tx_graph() -> anyhow::Result<()> {
155155
156156 env. mine_blocks ( 101 , None ) ?;
157157
158- let ( mut chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
158+ let ( mut chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
159159 let mut indexed_tx_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
160160 let mut index = SpkTxOutIndex :: < usize > :: default ( ) ;
161161 index. insert_spk ( 0 , addr_0. script_pubkey ( ) ) ;
@@ -255,10 +255,7 @@ fn ensure_block_emitted_after_reorg_is_at_reorg_height() -> anyhow::Result<()> {
255255 let env = TestEnv :: new ( ) ?;
256256 let mut emitter = Emitter :: new (
257257 env. rpc_client ( ) ,
258- CheckPoint :: new ( BlockId {
259- height : 0 ,
260- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
261- } ) ,
258+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
262259 EMITTER_START_HEIGHT as _ ,
263260 NO_EXPECTED_MEMPOOL_TXIDS ,
264261 ) ;
@@ -289,7 +286,7 @@ fn process_block(
289286 block : Block ,
290287 block_height : u32 ,
291288) -> anyhow:: Result < ( ) > {
292- recv_chain. apply_update ( CheckPoint :: from_header ( & block. header , block_height) ) ?;
289+ recv_chain. apply_header ( & block. header , block_height) ?;
293290 let _ = recv_graph. apply_block ( block, block_height) ;
294291 Ok ( ( ) )
295292}
@@ -337,10 +334,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
337334 let env = TestEnv :: new ( ) ?;
338335 let mut emitter = Emitter :: new (
339336 env. rpc_client ( ) ,
340- CheckPoint :: new ( BlockId {
341- height : 0 ,
342- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
343- } ) ,
337+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
344338 0 ,
345339 NO_EXPECTED_MEMPOOL_TXIDS ,
346340 ) ;
@@ -354,7 +348,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
354348 let addr_to_track = Address :: from_script ( & spk_to_track, bitcoin:: Network :: Regtest ) ?;
355349
356350 // setup receiver
357- let ( mut recv_chain, _) = LocalChain :: from_genesis_hash ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
351+ let ( mut recv_chain, _) = LocalChain :: from_genesis ( env. rpc_client ( ) . get_block_hash ( 0 ) ?) ;
358352 let mut recv_graph = IndexedTxGraph :: < BlockId , _ > :: new ( {
359353 let mut recv_index = SpkTxOutIndex :: default ( ) ;
360354 recv_index. insert_spk ( ( ) , spk_to_track. clone ( ) ) ;
@@ -429,10 +423,7 @@ fn mempool_avoids_re_emission() -> anyhow::Result<()> {
429423 let env = TestEnv :: new ( ) ?;
430424 let mut emitter = Emitter :: new (
431425 env. rpc_client ( ) ,
432- CheckPoint :: new ( BlockId {
433- height : 0 ,
434- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
435- } ) ,
426+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
436427 0 ,
437428 NO_EXPECTED_MEMPOOL_TXIDS ,
438429 ) ;
@@ -496,10 +487,7 @@ fn mempool_re_emits_if_tx_introduction_height_not_reached() -> anyhow::Result<()
496487 let env = TestEnv :: new ( ) ?;
497488 let mut emitter = Emitter :: new (
498489 env. rpc_client ( ) ,
499- CheckPoint :: new ( BlockId {
500- height : 0 ,
501- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
502- } ) ,
490+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
503491 0 ,
504492 NO_EXPECTED_MEMPOOL_TXIDS ,
505493 ) ;
@@ -588,10 +576,7 @@ fn mempool_during_reorg() -> anyhow::Result<()> {
588576 let env = TestEnv :: new ( ) ?;
589577 let mut emitter = Emitter :: new (
590578 env. rpc_client ( ) ,
591- CheckPoint :: new ( BlockId {
592- height : 0 ,
593- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
594- } ) ,
579+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
595580 0 ,
596581 NO_EXPECTED_MEMPOOL_TXIDS ,
597582 ) ;
@@ -716,10 +701,7 @@ fn no_agreement_point() -> anyhow::Result<()> {
716701 // start height is 99
717702 let mut emitter = Emitter :: new (
718703 env. rpc_client ( ) ,
719- CheckPoint :: new ( BlockId {
720- height : 0 ,
721- hash : env. rpc_client ( ) . get_block_hash ( 0 ) ?,
722- } ) ,
704+ CheckPoint :: new ( 0 , env. rpc_client ( ) . get_block_hash ( 0 ) ?) ,
723705 ( PREMINE_COUNT - 2 ) as u32 ,
724706 NO_EXPECTED_MEMPOOL_TXIDS ,
725707 ) ;
@@ -791,7 +773,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
791773 . 0 ;
792774 let spk = desc. at_derivation_index ( 0 ) ?. script_pubkey ( ) ;
793775
794- let mut chain = LocalChain :: from_genesis_hash ( genesis_block ( Network :: Regtest ) . block_hash ( ) ) . 0 ;
776+ let mut chain = LocalChain :: from_genesis ( genesis_block ( Network :: Regtest ) . block_hash ( ) ) . 0 ;
795777 let chain_tip = chain. tip ( ) . block_id ( ) ;
796778
797779 let mut index = SpkTxOutIndex :: default ( ) ;
@@ -808,7 +790,7 @@ fn test_expect_tx_evicted() -> anyhow::Result<()> {
808790 let mut emitter = Emitter :: new ( env. rpc_client ( ) , chain. tip ( ) , 1 , HashSet :: from ( [ txid_1] ) ) ;
809791 while let Some ( emission) = emitter. next_block ( ) ? {
810792 let height = emission. block_height ( ) ;
811- chain. apply_update ( CheckPoint :: from_header ( & emission. block . header , height) ) ?;
793+ chain. apply_header ( & emission. block . header , height) ?;
812794 }
813795
814796 let changeset = graph. batch_insert_unconfirmed ( emitter. mempool ( ) ?. new_txs ) ;
0 commit comments