@@ -62,8 +62,8 @@ fn receive_output_to_address(
6262 wallet. insert_tx ( tx) ;
6363
6464 match height {
65- ChainPosition :: Confirmed { .. } => {
66- insert_anchor_from_conf ( wallet, txid, height ) ;
65+ ChainPosition :: Confirmed ( anchor ) => {
66+ insert_anchor ( wallet, txid, anchor ) ;
6767 }
6868 ChainPosition :: Unconfirmed ( last_seen) => {
6969 insert_seen_at ( wallet, txid, last_seen) ;
@@ -1237,11 +1237,11 @@ fn test_create_tx_add_utxo() {
12371237 } ;
12381238 let txid = small_output_tx. compute_txid ( ) ;
12391239 wallet. insert_tx ( small_output_tx) ;
1240- let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
1241- block_id : wallet. latest_checkpoint ( ) . get ( 2000 ) . unwrap ( ) . block_id ( ) ,
1240+ let anchor = ConfirmationBlockTime {
1241+ block_id : wallet. latest_checkpoint ( ) . block_id ( ) ,
12421242 confirmation_time : 200 ,
1243- } ) ;
1244- insert_anchor_from_conf ( & mut wallet, txid, chain_position ) ;
1243+ } ;
1244+ insert_anchor ( & mut wallet, txid, anchor ) ;
12451245
12461246 let addr = Address :: from_str ( "2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX" )
12471247 . unwrap ( )
@@ -1284,11 +1284,11 @@ fn test_create_tx_manually_selected_insufficient() {
12841284 } ;
12851285 let txid = small_output_tx. compute_txid ( ) ;
12861286 wallet. insert_tx ( small_output_tx. clone ( ) ) ;
1287- let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
1288- block_id : wallet. latest_checkpoint ( ) . get ( 2000 ) . unwrap ( ) . block_id ( ) ,
1287+ let anchor = ConfirmationBlockTime {
1288+ block_id : wallet. latest_checkpoint ( ) . block_id ( ) ,
12891289 confirmation_time : 200 ,
1290- } ) ;
1291- insert_anchor_from_conf ( & mut wallet, txid, chain_position ) ;
1290+ } ;
1291+ insert_anchor ( & mut wallet, txid, anchor ) ;
12921292
12931293 let addr = Address :: from_str ( "2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX" )
12941294 . unwrap ( )
@@ -1845,11 +1845,11 @@ fn test_bump_fee_confirmed_tx() {
18451845
18461846 wallet. insert_tx ( tx) ;
18471847
1848- let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
1848+ let anchor = ConfirmationBlockTime {
18491849 block_id : wallet. latest_checkpoint ( ) . get ( 42 ) . unwrap ( ) . block_id ( ) ,
18501850 confirmation_time : 42_000 ,
1851- } ) ;
1852- insert_anchor_from_conf ( & mut wallet, txid, chain_position ) ;
1851+ } ;
1852+ insert_anchor ( & mut wallet, txid, anchor ) ;
18531853
18541854 wallet. build_fee_bump ( txid) . unwrap ( ) . finish ( ) . unwrap ( ) ;
18551855}
@@ -2122,11 +2122,11 @@ fn test_bump_fee_drain_wallet() {
21222122 } ;
21232123 let txid = tx. compute_txid ( ) ;
21242124 wallet. insert_tx ( tx. clone ( ) ) ;
2125- let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
2125+ let anchor = ConfirmationBlockTime {
21262126 block_id : wallet. latest_checkpoint ( ) . block_id ( ) ,
21272127 confirmation_time : 42_000 ,
2128- } ) ;
2129- insert_anchor_from_conf ( & mut wallet, txid, chain_position ) ;
2128+ } ;
2129+ insert_anchor ( & mut wallet, txid, anchor ) ;
21302130
21312131 let addr = Address :: from_str ( "2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX" )
21322132 . unwrap ( )
@@ -2182,15 +2182,13 @@ fn test_bump_fee_remove_output_manually_selected_only() {
21822182 value: Amount :: from_sat( 25_000 ) ,
21832183 } ] ,
21842184 } ;
2185- let position: ChainPosition < ConfirmationBlockTime > = wallet
2186- . transactions ( )
2187- . last ( )
2188- . unwrap ( )
2189- . chain_position
2190- . cloned ( ) ;
21912185
21922186 wallet. insert_tx ( init_tx. clone ( ) ) ;
2193- insert_anchor_from_conf ( & mut wallet, init_tx. compute_txid ( ) , position) ;
2187+ let anchor = ConfirmationBlockTime {
2188+ block_id : wallet. latest_checkpoint ( ) . block_id ( ) ,
2189+ confirmation_time : 200 ,
2190+ } ;
2191+ insert_anchor ( & mut wallet, init_tx. compute_txid ( ) , anchor) ;
21942192
21952193 let outpoint = OutPoint {
21962194 txid : init_tx. compute_txid ( ) ,
@@ -2235,14 +2233,12 @@ fn test_bump_fee_add_input() {
22352233 } ] ,
22362234 } ;
22372235 let txid = init_tx. compute_txid ( ) ;
2238- let pos: ChainPosition < ConfirmationBlockTime > = wallet
2239- . transactions ( )
2240- . last ( )
2241- . unwrap ( )
2242- . chain_position
2243- . cloned ( ) ;
22442236 wallet. insert_tx ( init_tx) ;
2245- insert_anchor_from_conf ( & mut wallet, txid, pos) ;
2237+ let anchor = ConfirmationBlockTime {
2238+ block_id : wallet. latest_checkpoint ( ) . block_id ( ) ,
2239+ confirmation_time : 200 ,
2240+ } ;
2241+ insert_anchor ( & mut wallet, txid, anchor) ;
22462242
22472243 let addr = Address :: from_str ( "2N1Ffz3WaNzbeLFBb51xyFMHYSEUXcbiSoX" )
22482244 . unwrap ( )
@@ -3886,11 +3882,11 @@ fn test_spend_coinbase() {
38863882 } ;
38873883 let txid = coinbase_tx. compute_txid ( ) ;
38883884 wallet. insert_tx ( coinbase_tx) ;
3889- let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
3885+ let anchor = ConfirmationBlockTime {
38903886 block_id : confirmation_block_id,
38913887 confirmation_time : 30_000 ,
3892- } ) ;
3893- insert_anchor_from_conf ( & mut wallet, txid, chain_position ) ;
3888+ } ;
3889+ insert_anchor ( & mut wallet, txid, anchor ) ;
38943890
38953891 let not_yet_mature_time = confirmation_height + COINBASE_MATURITY - 1 ;
38963892 let maturity_time = confirmation_height + COINBASE_MATURITY ;
@@ -4134,7 +4130,7 @@ fn test_keychains_with_overlapping_spks() {
41344130 . address ;
41354131 let chain_position = ChainPosition :: Confirmed ( ConfirmationBlockTime {
41364132 block_id : BlockId {
4137- height : 8000 ,
4133+ height : 2000 ,
41384134 hash : BlockHash :: all_zeros ( ) ,
41394135 } ,
41404136 confirmation_time : 0 ,
0 commit comments