@@ -297,7 +297,7 @@ pub fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {
297297 None ,
298298 ) ?;
299299 env. mine_blocks ( 1 , None ) ?;
300- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
300+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
301301
302302 // use a full checkpoint linked list (since this is not what we are testing)
303303 let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -409,7 +409,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
409409 None ,
410410 ) ?;
411411 env. mine_blocks ( 1 , None ) ?;
412- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
412+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
413413
414414 // use a full checkpoint linked list (since this is not what we are testing)
415415 let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -453,7 +453,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
453453 None ,
454454 ) ?;
455455 env. mine_blocks ( 1 , None ) ?;
456- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
456+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
457457
458458 // A scan with gap limit 5 won't find the second transaction, but a scan with gap limit 6 will.
459459 // The last active indice won't be updated in the first case but will in the second one.
@@ -521,7 +521,7 @@ fn test_sync() -> anyhow::Result<()> {
521521
522522 // Mine some blocks.
523523 env. mine_blocks ( 101 , Some ( addr_to_mine) ) ?;
524- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
524+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
525525
526526 // Broadcast transaction to mempool.
527527 let txid = env. send ( & addr_to_track, SEND_AMOUNT ) ?;
@@ -546,7 +546,7 @@ fn test_sync() -> anyhow::Result<()> {
546546
547547 // Mine block to confirm transaction.
548548 env. mine_blocks ( 1 , None ) ?;
549- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
549+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
550550
551551 let _ = sync_with_electrum (
552552 & client,
@@ -567,7 +567,7 @@ fn test_sync() -> anyhow::Result<()> {
567567
568568 // Perform reorg on block with confirmed transaction.
569569 env. reorg_empty_blocks ( 1 ) ?;
570- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
570+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
571571
572572 let _ = sync_with_electrum (
573573 & client,
@@ -587,7 +587,7 @@ fn test_sync() -> anyhow::Result<()> {
587587
588588 // Mine block to confirm transaction again.
589589 env. mine_blocks ( 1 , None ) ?;
590- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
590+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
591591
592592 let _ = sync_with_electrum ( & client, [ spk_to_track] , & mut recv_chain, & mut recv_graph) ?;
593593
@@ -630,7 +630,8 @@ fn test_sync() -> anyhow::Result<()> {
630630 Ok ( ( ) )
631631}
632632
633- /// Ensure that confirmed txs that are reorged become unconfirmed.
633+ /// Ensure transactions can become unconfirmed during reorg.
634+ /// ~Ensure that confirmed txs that are reorged become unconfirmed.~
634635///
635636/// 1. Mine 101 blocks.
636637/// 2. Mine 8 blocks with a confirmed tx in each.
@@ -674,7 +675,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
674675 }
675676
676677 // Sync up to tip.
677- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
678+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
678679 let update = sync_with_electrum (
679680 & client,
680681 [ spk_to_track. clone ( ) ] ,
@@ -705,7 +706,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
705706 for depth in 1 ..=REORG_COUNT {
706707 env. reorg_empty_blocks ( depth) ?;
707708
708- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
709+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
709710 let update = sync_with_electrum (
710711 & client,
711712 [ spk_to_track. clone ( ) ] ,
@@ -716,6 +717,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
716717 // Check that no new anchors are added during current reorg.
717718 assert ! ( initial_anchors. is_superset( & update. tx_update. anchors) ) ;
718719
720+ // TODO: Fails here.
719721 assert_eq ! (
720722 get_balance( & recv_chain, & recv_graph) ?,
721723 Balance {
@@ -751,7 +753,7 @@ fn test_sync_with_coinbase() -> anyhow::Result<()> {
751753
752754 // Mine some blocks.
753755 env. mine_blocks ( 101 , Some ( addr_to_track) ) ?;
754- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
756+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
755757
756758 // Check to see if electrum syncs properly.
757759 assert ! ( sync_with_electrum(
@@ -829,7 +831,7 @@ fn test_check_fee_calculation() -> anyhow::Result<()> {
829831 } ;
830832
831833 // Sync up to tip.
832- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
834+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
833835 let _ = sync_with_electrum (
834836 & client,
835837 [ spk_to_track. clone ( ) ] ,
0 commit comments