From 263e87fcf51d191a2bc32cbfe3fe1b5732fce788 Mon Sep 17 00:00:00 2001 From: Philip Robinson Date: Wed, 28 Jul 2021 16:20:37 +0200 Subject: [PATCH] Update LibWallet recovery task event handling The recovery task broke out of its monitoring loop before getting the `UtxoScannerEvent::Completed` event. This PR just moves that break statement so that the final completed callback is made. Also Ignore `test_store_and_forward_send_tx` due to it being flakey on CI and the functionality is covered by Cucumber tests. --- base_layer/wallet/tests/wallet/mod.rs | 2 ++ base_layer/wallet_ffi/src/tasks.rs | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/base_layer/wallet/tests/wallet/mod.rs b/base_layer/wallet/tests/wallet/mod.rs index adb3c3b4a3..9888163a10 100644 --- a/base_layer/wallet/tests/wallet/mod.rs +++ b/base_layer/wallet/tests/wallet/mod.rs @@ -504,6 +504,8 @@ fn test_20_store_and_forward_send_tx() { } #[test] +#[ignore = "Flakey on CI, theory is that it is due to SAF neighbourhoods. Retry after Kademlia style neighbourhoods \ + are included"] fn test_store_and_forward_send_tx() { let mut shutdown_a = Shutdown::new(); let mut shutdown_b = Shutdown::new(); diff --git a/base_layer/wallet_ffi/src/tasks.rs b/base_layer/wallet_ffi/src/tasks.rs index 0b69cd72ea..c4ce4e2e17 100644 --- a/base_layer/wallet_ffi/src/tasks.rs +++ b/base_layer/wallet_ffi/src/tasks.rs @@ -95,10 +95,6 @@ pub async fn recovery_event_monitoring( (recovery_progress_callback)(RecoveryEvent::Progress as u8, current, total); } info!(target: LOG_TARGET, "Recovery progress: {}/{}", current, total); - if current == total { - info!(target: LOG_TARGET, "Recovery complete: {}/{}", current, total); - break; - } }, Ok(UtxoScannerEvent::Completed { number_scanned: num_scanned, @@ -118,6 +114,7 @@ pub async fn recovery_event_monitoring( unsafe { (recovery_progress_callback)(RecoveryEvent::Completed as u8, num_scanned, u64::from(total_amount)); } + break; }, Ok(UtxoScannerEvent::ScanningRoundFailed { num_retries,