@@ -92,7 +92,7 @@ pub fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {
92
92
None ,
93
93
) ?;
94
94
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 ) ) ?;
96
96
97
97
// use a full checkpoint linked list (since this is not what we are testing)
98
98
let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -204,7 +204,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
204
204
None ,
205
205
) ?;
206
206
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 ) ) ?;
208
208
209
209
// use a full checkpoint linked list (since this is not what we are testing)
210
210
let cp_tip = env. make_checkpoint_tip ( ) ;
@@ -248,7 +248,7 @@ pub fn test_update_tx_graph_stop_gap() -> anyhow::Result<()> {
248
248
None ,
249
249
) ?;
250
250
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 ) ) ?;
252
252
253
253
// A scan with gap limit 5 won't find the second transaction, but a scan with gap limit 6 will.
254
254
// 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<()> {
316
316
317
317
// Mine some blocks.
318
318
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 ) ) ?;
320
320
321
321
// Broadcast transaction to mempool.
322
322
let txid = env. send ( & addr_to_track, SEND_AMOUNT ) ?;
@@ -341,7 +341,7 @@ fn test_sync() -> anyhow::Result<()> {
341
341
342
342
// Mine block to confirm transaction.
343
343
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 ) ) ?;
345
345
346
346
let _ = sync_with_electrum (
347
347
& client,
@@ -362,7 +362,7 @@ fn test_sync() -> anyhow::Result<()> {
362
362
363
363
// Perform reorg on block with confirmed transaction.
364
364
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 ) ) ?;
366
366
367
367
let _ = sync_with_electrum (
368
368
& client,
@@ -382,7 +382,7 @@ fn test_sync() -> anyhow::Result<()> {
382
382
383
383
// Mine block to confirm transaction again.
384
384
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 ) ) ?;
386
386
387
387
let _ = sync_with_electrum ( & client, [ spk_to_track] , & mut recv_chain, & mut recv_graph) ?;
388
388
@@ -425,7 +425,8 @@ fn test_sync() -> anyhow::Result<()> {
425
425
Ok ( ( ) )
426
426
}
427
427
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.~
429
430
///
430
431
/// 1. Mine 101 blocks.
431
432
/// 2. Mine 8 blocks with a confirmed tx in each.
@@ -469,7 +470,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
469
470
}
470
471
471
472
// 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 ) ) ?;
473
474
let update = sync_with_electrum (
474
475
& client,
475
476
[ spk_to_track. clone ( ) ] ,
@@ -500,7 +501,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
500
501
for depth in 1 ..=REORG_COUNT {
501
502
env. reorg_empty_blocks ( depth) ?;
502
503
503
- env. wait_until_electrum_sees_block ( Duration :: from_secs ( 6 ) ) ?;
504
+ env. wait_until_electrum_tip_syncs_with_bitcoind ( Duration :: from_secs ( 6 ) ) ?;
504
505
let update = sync_with_electrum (
505
506
& client,
506
507
[ spk_to_track. clone ( ) ] ,
@@ -511,6 +512,7 @@ fn tx_can_become_unconfirmed_after_reorg() -> anyhow::Result<()> {
511
512
// Check that no new anchors are added during current reorg.
512
513
assert ! ( initial_anchors. is_superset( & update. tx_update. anchors) ) ;
513
514
515
+ // TODO: Fails here.
514
516
assert_eq ! (
515
517
get_balance( & recv_chain, & recv_graph) ?,
516
518
Balance {
0 commit comments