@@ -92,7 +92,7 @@ pub fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {
9292 None ,
9393 ) ?;
9494 env. mine_blocks ( 1 , None ) ?;
95- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
95+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
9696
9797 // use a full checkpoint linked list (since this is not what we are testing)
9898 let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -204,7 +204,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
204204 None ,
205205 ) ?;
206206 env. mine_blocks ( 1 , None ) ?;
207- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
207+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
208208
209209 // use a full checkpoint linked list (since this is not what we are testing)
210210 let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -248,7 +248,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
248248 None ,
249249 ) ?;
250250 env. mine_blocks ( 1 , None ) ?;
251- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
251+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
252252
253253 // A scan with gap limit 5 won't find the second transaction, but a scan with gap limit 6 will.
254254 // The last active indice won't be updated in the first case but will in the second one.
@@ -316,7 +316,7 @@ fn test_sync() -> anyhow::Result<()> {
316316
317317 // Mine some blocks.
318318 env. mine_blocks ( 101 , Some ( addr_to_mine) ) ?;
319- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
319+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
320320
321321 // Broadcast transaction to mempool.
322322 let txid = env. send ( & addr_to_track, SEND_AMOUNT ) ?;
@@ -341,7 +341,7 @@ fn test_sync() -> anyhow::Result<()> {
341341
342342 // Mine block to confirm transaction.
343343 env. mine_blocks ( 1 , None ) ?;
344- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
344+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
345345
346346 let _ = sync_with_electrum (
347347 & client,
@@ -362,7 +362,7 @@ fn test_sync() -> anyhow::Result<()> {
362362
363363 // Perform reorg on block with confirmed transaction.
364364 env. reorg_empty_blocks ( 1 ) ?;
365- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
365+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
366366
367367 let _ = sync_with_electrum (
368368 & client,
@@ -382,7 +382,7 @@ fn test_sync() -> anyhow::Result<()> {
382382
383383 // Mine block to confirm transaction again.
384384 env. mine_blocks ( 1 , None ) ?;
385- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
385+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
386386
387387 let _ = sync_with_electrum ( & client, [ spk_to_track] , & mut recv_chain, & mut recv_graph) ?;
388388
@@ -425,7 +425,8 @@ fn test_sync() -> anyhow::Result<()> {
425425 Ok ( ( ) )
426426}
427427
428- /// Ensure that confirmed txs that are reorged become unconfirmed.
428+ /// Ensure transactions can become unconfirmed during reorg.
429+ /// ~Ensure that confirmed txs that are reorged become unconfirmed.~
429430///
430431/// 1. Mine 101 blocks.
431432/// 2. Mine 8 blocks with a confirmed tx in each.
@@ -469,7 +470,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
469470 }
470471
471472 // Sync up to tip.
472- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
473+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
473474 let update = sync_with_electrum (
474475 & client,
475476 [ spk_to_track. clone ( ) ] ,
@@ -500,7 +501,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
500501 for depth in 1 ..=REORG_COUNT {
501502 env. reorg_empty_blocks ( depth) ?;
502503
503- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
504+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
504505 let update = sync_with_electrum (
505506 & client,
506507 [ spk_to_track. clone ( ) ] ,
@@ -511,6 +512,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
511512 // Check that no new anchors are added during current reorg.
512513 assert ! ( initial_anchors. is_superset( & update. tx_update. anchors) ) ;
513514
515+ // TODO: Fails here.
514516 assert_eq ! (
515517 get_balance( & recv_chain, & recv_graph) ?,
516518 Balance {
0 commit comments