@@ -297,7 +297,7 @@ pub fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {
297
297
None ,
298
298
) ?;
299
299
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 ) ) ?;
301
301
302
302
// use a full checkpoint linked list (since this is not what we are testing)
303
303
let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -409,7 +409,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
409
409
None ,
410
410
) ?;
411
411
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 ) ) ?;
413
413
414
414
// use a full checkpoint linked list (since this is not what we are testing)
415
415
let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -453,7 +453,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
453
453
None ,
454
454
) ?;
455
455
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 ) ) ?;
457
457
458
458
// A scan with gap limit 5 won't find the second transaction, but a scan with gap limit 6 will.
459
459
// 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<()> {
521
521
522
522
// Mine some blocks.
523
523
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 ) ) ?;
525
525
526
526
// Broadcast transaction to mempool.
527
527
let txid = env. send ( & addr_to_track, SEND_AMOUNT ) ?;
@@ -546,7 +546,7 @@ fn test_sync() -> anyhow::Result<()> {
546
546
547
547
// Mine block to confirm transaction.
548
548
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 ) ) ?;
550
550
551
551
let _ = sync_with_electrum (
552
552
& client,
@@ -567,7 +567,7 @@ fn test_sync() -> anyhow::Result<()> {
567
567
568
568
// Perform reorg on block with confirmed transaction.
569
569
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 ) ) ?;
571
571
572
572
let _ = sync_with_electrum (
573
573
& client,
@@ -587,7 +587,7 @@ fn test_sync() -> anyhow::Result<()> {
587
587
588
588
// Mine block to confirm transaction again.
589
589
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 ) ) ?;
591
591
592
592
let _ = sync_with_electrum ( & client, [ spk_to_track] , & mut recv_chain, & mut recv_graph) ?;
593
593
@@ -630,7 +630,8 @@ fn test_sync() -> anyhow::Result<()> {
630
630
Ok ( ( ) )
631
631
}
632
632
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.~
634
635
///
635
636
/// 1. Mine 101 blocks.
636
637
/// 2. Mine 8 blocks with a confirmed tx in each.
@@ -674,7 +675,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
674
675
}
675
676
676
677
// 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 ) ) ?;
678
679
let update = sync_with_electrum (
679
680
& client,
680
681
[ spk_to_track. clone ( ) ] ,
@@ -705,7 +706,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
705
706
for depth in 1 ..=REORG_COUNT {
706
707
env. reorg_empty_blocks ( depth) ?;
707
708
708
- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
709
+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
709
710
let update = sync_with_electrum (
710
711
& client,
711
712
[ spk_to_track. clone ( ) ] ,
@@ -716,6 +717,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
716
717
// Check that no new anchors are added during current reorg.
717
718
assert ! ( initial_anchors. is_superset( & update. tx_update. anchors) ) ;
718
719
720
+ // TODO: Fails here.
719
721
assert_eq ! (
720
722
get_balance( & recv_chain, & recv_graph) ?,
721
723
Balance {
@@ -751,7 +753,7 @@ fn test_sync_with_coinbase() -> anyhow::Result<()> {
751
753
752
754
// Mine some blocks.
753
755
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 ) ) ?;
755
757
756
758
// Check to see if electrum syncs properly.
757
759
assert ! ( sync_with_electrum(
@@ -829,7 +831,7 @@ fn test_check_fee_calculation() -> anyhow::Result<()> {
829
831
} ;
830
832
831
833
// 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 ) ) ?;
833
835
let _ = sync_with_electrum (
834
836
& client,
835
837
[ spk_to_track. clone ( ) ] ,
0 commit comments