Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-728: Finish the password-change logic #355

Merged
merged 95 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d2c5b77
GH-728: add the TODOs
utkarshg6 Oct 11, 2023
aec029f
GH-728: removed the code of the NewPasswordMessage
utkarshg6 Oct 23, 2023
a39a0c8
GH-728: use ConfigurationChangeMessage while changing password
utkarshg6 Oct 23, 2023
4ced510
Merge branch 'master' into GH-728
utkarshg6 Oct 23, 2023
b376e92
GH-728: rename configuration_change_msg_sub_opt to update_min_hops_su…
utkarshg6 Oct 24, 2023
b55577a
GH-728: rename new_password_subs to update_password_subs
utkarshg6 Oct 24, 2023
79b6b9a
GH-728: fix wrong name for the actor message
utkarshg6 Oct 24, 2023
8204b01
GH-728: send ConfigurationChangeMessage to other actors too
utkarshg6 Oct 25, 2023
5aa8f0c
GH-728: add a TODO
utkarshg6 Oct 30, 2023
87dcf89
GH-728: rename to _opt
utkarshg6 Oct 30, 2023
507b130
GH-728: implement handler for ConfigurationChange::UpdatePassword ins…
utkarshg6 Oct 30, 2023
4d07e27
Merge branch 'master' into GH-728
utkarshg6 Nov 2, 2023
04533e4
GH-728: add TODO to implement handler for ConfigurationChange::Update…
utkarshg6 Nov 2, 2023
d59409d
GH-728: add TODO to implement handler for ConfigurationChange::Update…
utkarshg6 Nov 2, 2023
c2d0cad
GH-728: create new struct for UpdatePasswordSubs
utkarshg6 Nov 2, 2023
6a8086e
GH-728: add the new TODO
utkarshg6 Jan 23, 2024
3ec34fe
GH-728: send a ConfigurtionChangeMessage when the consuming wallet is…
utkarshg6 Jan 23, 2024
e8edd34
GH-728: add a test for the panic case
utkarshg6 Jan 23, 2024
bfcafdb
GH-728: some refactor changes in configurator.rs
utkarshg6 Jan 23, 2024
2fedf65
GH-728: test drive the case when the wallet is recovered
utkarshg6 Jan 23, 2024
90385a5
GH-728: fix some of the tests
utkarshg6 Jan 25, 2024
2bed071
GH-728: fix the remaining 2 failing tests
utkarshg6 Jan 26, 2024
aef323a
GH-728: reorder fields
utkarshg6 Jan 26, 2024
06aea8e
GH-728: the received ConfigurationChangeMessage is properly handled
utkarshg6 Feb 6, 2024
595a806
Merge branch 'master' into GH-728
utkarshg6 Feb 6, 2024
5f50515
GH-728: update the password when necessary
utkarshg6 Feb 6, 2024
1912a1b
GH-728: add a todo
utkarshg6 Feb 6, 2024
6cab5ef
GH-728: add the ability to synchronise password
utkarshg6 Feb 7, 2024
6ecfe83
GH-728: add ability for accountant to handle an unexpected configurat…
utkarshg6 Feb 8, 2024
f74fb14
GH-728: improve tests for handling ConfigurationChangeMessage in acco…
utkarshg6 Feb 8, 2024
6dd6e72
GH-728: minor renames
utkarshg6 Feb 8, 2024
4b9f138
GH-728: remove finished TODO and formatting changes
utkarshg6 Feb 9, 2024
3de454f
GH-728: add test in blockchain bridge for ConfigurationChangeMessage
utkarshg6 Feb 9, 2024
33b23c5
GH-728: add test in neighborhood for ConfigurationChangeMessage
utkarshg6 Feb 9, 2024
2595ae8
GH-728: remove useless tests
utkarshg6 Feb 9, 2024
a4e0e7a
Merge branch 'master' of https://github.com/MASQ-Project/Node into GH…
utkarshg6 Feb 9, 2024
0f85fe2
GH-728: revive an old test
utkarshg6 Feb 12, 2024
416a14c
GH-728: improve todo
utkarshg6 Feb 12, 2024
42adcff
GH-728: test rename and add more TODOs
utkarshg6 Feb 12, 2024
20f8354
GH-728: cleanup and creation of new file configuration_change_subs.rs
utkarshg6 Feb 12, 2024
c27cc6d
GH-728: minor refactor and remove tests
utkarshg6 Feb 12, 2024
30f3dc6
GH-728: introduce trait for ConfigurationChangesubs
utkarshg6 Feb 12, 2024
7b28dd9
GH-728: refactor out the subs for UpdateWallets and UpdatePassword
utkarshg6 Feb 13, 2024
0d3f0b8
GH-728: some renames
utkarshg6 Feb 13, 2024
9729001
GH-728: add TODO and minor reordering
utkarshg6 Feb 13, 2024
ba7b868
GH-728: make the test the_password_is_synchronised_among_other_actors…
utkarshg6 Feb 13, 2024
15a0317
GH-728: add formatting changes
utkarshg6 Feb 13, 2024
85da70b
GH-728: make enum usage more explicit
utkarshg6 Feb 13, 2024
818f535
GH-728: remove clippy warnings
utkarshg6 Feb 13, 2024
0647933
GH-728: do some renames
utkarshg6 Feb 14, 2024
6a1b5e0
GH-728: fix wrong rename and import
utkarshg6 Feb 14, 2024
e92730a
GH-728: use peer actors for generating config change subs
utkarshg6 Feb 27, 2024
acf39f2
GH-728: recreate ConfigChangeSubs
utkarshg6 Feb 28, 2024
885d528
GH-728: remove config_change_subs.rs
utkarshg6 Feb 28, 2024
4b71c31
GH-728: test for ConfigChangeMsg in Accountant contain assertions
utkarshg6 Feb 28, 2024
c3a34e1
GH-728: test for ConfigChangeMsg in Neighborhood contain assertions
utkarshg6 Feb 28, 2024
83add77
GH-728: test for ConfigChangeMsg in BlockchainBridge contain assertions
utkarshg6 Feb 28, 2024
1b71118
GH-728: small rename
utkarshg6 Mar 4, 2024
4aea52a
GH-728: add context_id to fn
utkarshg6 Mar 4, 2024
8507172
GH-728: refactor the fn to transform associated functions to methods
utkarshg6 Mar 4, 2024
8ce0429
GH-728: minor fixes
utkarshg6 Mar 4, 2024
e956d9f
GH-728: add wallet_opt as a new argument in the begin_scan fn
utkarshg6 Mar 5, 2024
ae6984e
GH-728: remove the use of field consuming_wallet_opt from BlockchainB…
utkarshg6 Mar 5, 2024
0eeb7b1
GH-728: remove the field consuming_wallet_opt from BlockchainBridge
utkarshg6 Mar 5, 2024
0b67ba2
GH-728: don't send the ConfigChangeMsg to the BlockchainBridge
utkarshg6 Mar 5, 2024
4d8e37e
GH-728: use the earning wallet in Receivable Scanner's begin_scan
utkarshg6 Mar 5, 2024
07457e7
GH-728: don't save a reference of earning wallet inside Scanners
utkarshg6 Mar 5, 2024
d99142e
GH-728: store the earning wallet directly without an Rc
utkarshg6 Mar 5, 2024
a8a4d04
GH-728: fix the failing test
utkarshg6 Mar 6, 2024
5d381e4
GH-728: formatting changes
utkarshg6 Mar 6, 2024
f778208
GH-728: remove the earning wallet from ReceivableScannerBuilder
utkarshg6 Mar 7, 2024
962ec0a
GH-728: check wallet in the begin_scan() for ScannerMock
utkarshg6 Mar 7, 2024
778d615
GH-728: remove unnecessary TODO
utkarshg6 Mar 7, 2024
b7243e5
GH-728: formatting changes
utkarshg6 Mar 7, 2024
bd9ea99
GH-728: fix the failing test
utkarshg6 Mar 7, 2024
8224cc0
Merge branch 'master' into GH-728
utkarshg6 Mar 13, 2024
8df5537
GH-728: remove unused import in blockchain_interaction_test.rs
utkarshg6 Mar 14, 2024
90dc6fa
GH-728: BlockchainBridge receives consuming_wallet instead of an Opti…
utkarshg6 Mar 15, 2024
7211a8f
GH-728: Check consuming wallet before sending a msg to BlockchainBridge
utkarshg6 Mar 15, 2024
be55fa7
GH-728: remove Option<T> from the wallet_opt param in begin_scan fn
utkarshg6 Mar 15, 2024
c14d9b4
GH-728: remove commented out code
utkarshg6 Mar 15, 2024
dec9c3f
GH-728: modify AccountantBuilder to make it's field names contain opt
utkarshg6 Mar 18, 2024
2a78da9
GH-728: improve test mocks
utkarshg6 Mar 18, 2024
3d8b011
GH-728: introduce another URL for mumbai testnet
utkarshg6 Mar 19, 2024
ca20828
GH-728: change the message in trace log
utkarshg6 Mar 19, 2024
30c4439
GH-728: test drive the NoConsumingWallet Error
utkarshg6 Mar 19, 2024
cd97bdf
GH-728: reordering
utkarshg6 Mar 19, 2024
f898def
GH-728: add better logging
utkarshg6 Mar 20, 2024
0ed2608
GH-728: Review 2 changes
utkarshg6 Mar 21, 2024
8af33c6
GH-728: Review 2 leftover changes
utkarshg6 Mar 21, 2024
37c3b79
GH-728: add better assertions for logger
utkarshg6 Mar 22, 2024
b13c22d
Merge branch 'master' into GH-728
utkarshg6 Apr 2, 2024
92c0bcc
Merge branch 'master' into GH-728
utkarshg6 May 4, 2024
8a75ff4
Merge branch 'master' into GH-728
utkarshg6 May 29, 2024
c567c12
Merge branch 'master' into GH-728
utkarshg6 May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::path::PathBuf;
use std::time::{Duration, SystemTime};

use log::Level;
use regex::escape;
use serde_derive::Serialize;

use masq_lib::messages::{FromMessageBody, ScanType, ToMessageBody, UiScanRequest, UiScanResponse};
Expand Down Expand Up @@ -157,19 +156,15 @@ fn blockchain_bridge_starts_properly_on_bootstrap() {
let mut cluster = MASQNodeCluster::start().unwrap();
let private_key = "0011223300112233001122330011223300112233001122330011223300112233";
let subject = cluster.start_real_node(
NodeStartupConfigBuilder::zero_hop()
NodeStartupConfigBuilder::standard()
.consuming_wallet_info(ConsumingWalletInfo::PrivateKey(private_key.to_string()))
.chain(cluster.chain)
.build(),
);

let escaped_pattern = escape(&format!(
"DEBUG: BlockchainBridge: Received BindMessage; consuming wallet address {}",
subject.consuming_wallet().unwrap()
));
MASQNodeUtils::wrote_log_containing(
subject.name(),
&escaped_pattern,
"DEBUG: BlockchainBridge: Received BindMessage",
Duration::from_millis(1000),
)
}
Expand Down
295 changes: 267 additions & 28 deletions node/src/accountant/mod.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@

use crate::accountant::scanners::mid_scan_msg_handling::payable_scanner::blockchain_agent::BlockchainAgent;
use crate::accountant::{ResponseSkeleton, SkeletonOptHolder};
use crate::sub_lib::wallet::Wallet;
use actix::Message;
use masq_lib::type_obfuscation::Obfuscated;
use std::fmt::Debug;

#[derive(Debug, Message, PartialEq, Eq, Clone)]
pub struct QualifiedPayablesMessage {
pub protected_qualified_payables: Obfuscated,
pub consuming_wallet: Wallet,
pub response_skeleton_opt: Option<ResponseSkeleton>,
}

impl QualifiedPayablesMessage {
pub(in crate::accountant) fn new(
protected_qualified_payables: Obfuscated,
consuming_wallet: Wallet,
response_skeleton_opt: Option<ResponseSkeleton>,
) -> Self {
Self {
protected_qualified_payables,
consuming_wallet,
response_skeleton_opt,
}
}
Expand Down
93 changes: 59 additions & 34 deletions node/src/accountant/scanners/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ impl Scanners {
pub fn new(
dao_factories: DaoFactories,
payment_thresholds: Rc<PaymentThresholds>,
earning_wallet: Rc<Wallet>,
when_pending_too_long_sec: u64,
financial_statistics: Rc<RefCell<FinancialStatistics>>,
) -> Self {
Expand All @@ -94,7 +93,6 @@ impl Scanners {
dao_factories.banned_dao_factory.make(),
Box::new(persistent_configuration),
Rc::clone(&payment_thresholds),
earning_wallet,
financial_statistics,
));

Expand All @@ -113,6 +111,7 @@ where
{
fn begin_scan(
&mut self,
wallet: Wallet,
timestamp: SystemTime,
response_skeleton_opt: Option<ResponseSkeleton>,
logger: &Logger,
Expand Down Expand Up @@ -193,6 +192,7 @@ pub struct PayableScanner {
impl Scanner<QualifiedPayablesMessage, SentPayables> for PayableScanner {
fn begin_scan(
&mut self,
consuming_wallet: Wallet,
timestamp: SystemTime,
response_skeleton_opt: Option<ResponseSkeleton>,
logger: &Logger,
Expand Down Expand Up @@ -225,8 +225,11 @@ impl Scanner<QualifiedPayablesMessage, SentPayables> for PayableScanner {
qualified_payables.len()
);
let protected_payables = self.protect_payables(qualified_payables);
let outgoing_msg =
QualifiedPayablesMessage::new(protected_payables, response_skeleton_opt);
let outgoing_msg = QualifiedPayablesMessage::new(
protected_payables,
consuming_wallet,
response_skeleton_opt,
);
Ok(outgoing_msg)
}
}
Expand Down Expand Up @@ -567,6 +570,7 @@ pub struct PendingPayableScanner {
impl Scanner<RequestTransactionReceipts, ReportTransactionReceipts> for PendingPayableScanner {
fn begin_scan(
&mut self,
_irrelevant_wallet: Wallet,
timestamp: SystemTime,
response_skeleton_opt: Option<ResponseSkeleton>,
logger: &Logger,
Expand Down Expand Up @@ -825,13 +829,13 @@ pub struct ReceivableScanner {
pub receivable_dao: Box<dyn ReceivableDao>,
pub banned_dao: Box<dyn BannedDao>,
pub persistent_configuration: Box<dyn PersistentConfiguration>,
pub earning_wallet: Rc<Wallet>,
pub financial_statistics: Rc<RefCell<FinancialStatistics>>,
}

impl Scanner<RetrieveTransactions, ReceivedPayments> for ReceivableScanner {
fn begin_scan(
&mut self,
earning_wallet: Wallet,
timestamp: SystemTime,
response_skeleton_opt: Option<ResponseSkeleton>,
logger: &Logger,
Expand All @@ -840,14 +844,11 @@ impl Scanner<RetrieveTransactions, ReceivedPayments> for ReceivableScanner {
return Err(BeginScanError::ScanAlreadyRunning(timestamp));
}
self.mark_as_started(timestamp);
info!(
logger,
"Scanning for receivables to {}", self.earning_wallet
);
info!(logger, "Scanning for receivables to {}", earning_wallet);
self.scan_for_delinquencies(timestamp, logger);

Ok(RetrieveTransactions {
recipient: self.earning_wallet.as_ref().clone(),
recipient: earning_wallet,
response_skeleton_opt,
})
}
Expand Down Expand Up @@ -893,12 +894,10 @@ impl ReceivableScanner {
banned_dao: Box<dyn BannedDao>,
persistent_configuration: Box<dyn PersistentConfiguration>,
payment_thresholds: Rc<PaymentThresholds>,
earning_wallet: Rc<Wallet>,
financial_statistics: Rc<RefCell<FinancialStatistics>>,
) -> Self {
Self {
common: ScannerCommon::new(payment_thresholds),
earning_wallet,
receivable_dao,
banned_dao,
persistent_configuration,
Expand Down Expand Up @@ -985,6 +984,7 @@ impl ReceivableScanner {
#[derive(Debug, PartialEq, Eq)]
pub enum BeginScanError {
NothingToProcess,
NoConsumingWalletFound,
ScanAlreadyRunning(SystemTime),
CalledFromNullScanner, // Exclusive for tests
}
Expand All @@ -1007,6 +1007,10 @@ impl BeginScanError {
scan_type,
BeginScanError::timestamp_as_string(timestamp)
)),
BeginScanError::NoConsumingWalletFound => Some(format!(
"Cannot initiate {:?} scan because no consuming wallet was found.",
scan_type
)),
BeginScanError::CalledFromNullScanner => match cfg!(test) {
true => None,
false => panic!("Null Scanner shouldn't be running inside production code."),
Expand Down Expand Up @@ -1134,9 +1138,9 @@ mod tests {
DaoFactories, FinancialStatistics, PaymentThresholds, ScanIntervals,
DEFAULT_PAYMENT_THRESHOLDS,
};
use crate::test_utils::make_wallet;
use crate::test_utils::persistent_configuration_mock::PersistentConfigurationMock;
use crate::test_utils::unshared_test_utils::arbitrary_id_stamp::ArbitraryIdStamp;
use crate::test_utils::{make_paying_wallet, make_wallet};
use actix::{Message, System};
use ethereum_types::U64;
use masq_lib::logger::Logger;
Expand Down Expand Up @@ -1175,7 +1179,6 @@ mod tests {
total_paid_payable_wei: 1,
total_paid_receivable_wei: 2,
};
let earning_wallet = make_wallet("unique_wallet");
let payment_thresholds = make_custom_payment_thresholds();
let payment_thresholds_rc = Rc::new(payment_thresholds);
let initial_rc_count = Rc::strong_count(&payment_thresholds_rc);
Expand All @@ -1189,7 +1192,6 @@ mod tests {
config_dao_factory: Box::new(config_dao_factory),
},
Rc::clone(&payment_thresholds_rc),
Rc::new(earning_wallet.clone()),
when_pending_too_long_sec,
Rc::new(RefCell::new(financial_statistics.clone())),
);
Expand Down Expand Up @@ -1234,10 +1236,6 @@ mod tests {
*receivable_scanner.financial_statistics.borrow(),
financial_statistics
);
assert_eq!(
receivable_scanner.earning_wallet.address(),
earning_wallet.address()
);
assert_eq!(
receivable_scanner.common.payment_thresholds.as_ref(),
&payment_thresholds
Expand Down Expand Up @@ -1274,6 +1272,7 @@ mod tests {
fn payable_scanner_can_initiate_a_scan() {
init_test_logging();
let test_name = "payable_scanner_can_initiate_a_scan";
let consuming_wallet = make_paying_wallet(b"consuming wallet");
let now = SystemTime::now();
let (qualified_payable_accounts, _, all_non_pending_payables) =
make_payables(now, &PaymentThresholds::default());
Expand All @@ -1283,7 +1282,8 @@ mod tests {
.payable_dao(payable_dao)
.build();

let result = subject.begin_scan(now, None, &Logger::new(test_name));
let result =
subject.begin_scan(consuming_wallet.clone(), now, None, &Logger::new(test_name));

let timestamp = subject.scan_started_at();
assert_eq!(timestamp, Some(now));
Expand All @@ -1293,6 +1293,7 @@ mod tests {
protected_qualified_payables: protect_payables_in_test(
qualified_payable_accounts.clone()
),
consuming_wallet,
response_skeleton_opt: None,
})
);
Expand All @@ -1307,16 +1308,22 @@ mod tests {

#[test]
fn payable_scanner_throws_error_when_a_scan_is_already_running() {
let consuming_wallet = make_paying_wallet(b"consuming wallet");
let now = SystemTime::now();
let (_, _, all_non_pending_payables) = make_payables(now, &PaymentThresholds::default());
let payable_dao =
PayableDaoMock::new().non_pending_payables_result(all_non_pending_payables);
let mut subject = PayableScannerBuilder::new()
.payable_dao(payable_dao)
.build();
let _result = subject.begin_scan(now, None, &Logger::new("test"));
let _result = subject.begin_scan(consuming_wallet.clone(), now, None, &Logger::new("test"));

let run_again_result = subject.begin_scan(SystemTime::now(), None, &Logger::new("test"));
let run_again_result = subject.begin_scan(
consuming_wallet,
SystemTime::now(),
None,
&Logger::new("test"),
);

let is_scan_running = subject.scan_started_at().is_some();
assert_eq!(is_scan_running, true);
Expand All @@ -1328,6 +1335,7 @@ mod tests {

#[test]
fn payable_scanner_throws_error_in_case_no_qualified_payable_is_found() {
let consuming_wallet = make_paying_wallet(b"consuming wallet");
let now = SystemTime::now();
let (_, unqualified_payable_accounts, _) =
make_payables(now, &PaymentThresholds::default());
Expand All @@ -1337,7 +1345,7 @@ mod tests {
.payable_dao(payable_dao)
.build();

let result = subject.begin_scan(now, None, &Logger::new("test"));
let result = subject.begin_scan(consuming_wallet, now, None, &Logger::new("test"));

let is_scan_running = subject.scan_started_at().is_some();
assert_eq!(is_scan_running, false);
Expand Down Expand Up @@ -2210,6 +2218,7 @@ mod tests {
fn pending_payable_scanner_can_initiate_a_scan() {
init_test_logging();
let test_name = "pending_payable_scanner_can_initiate_a_scan";
let consuming_wallet = make_paying_wallet(b"consuming wallet");
let now = SystemTime::now();
let payable_fingerprint_1 = PendingPayableFingerprint {
rowid: 555,
Expand All @@ -2234,7 +2243,12 @@ mod tests {
.pending_payable_dao(pending_payable_dao)
.build();

let result = pending_payable_scanner.begin_scan(now, None, &Logger::new(test_name));
let result = pending_payable_scanner.begin_scan(
consuming_wallet,
now,
None,
&Logger::new(test_name),
);

let no_of_pending_payables = fingerprints.len();
let is_scan_running = pending_payable_scanner.scan_started_at().is_some();
Expand All @@ -2257,6 +2271,7 @@ mod tests {
#[test]
fn pending_payable_scanner_throws_error_in_case_scan_is_already_running() {
let now = SystemTime::now();
let consuming_wallet = make_paying_wallet(b"consuming");
let pending_payable_dao = PendingPayableDaoMock::new()
.return_all_errorless_fingerprints_result(vec![PendingPayableFingerprint {
rowid: 1234,
Expand All @@ -2270,9 +2285,9 @@ mod tests {
.pending_payable_dao(pending_payable_dao)
.build();
let logger = Logger::new("test");
let _ = subject.begin_scan(now, None, &logger);
let _ = subject.begin_scan(consuming_wallet.clone(), now, None, &logger);

let result = subject.begin_scan(SystemTime::now(), None, &logger);
let result = subject.begin_scan(consuming_wallet, SystemTime::now(), None, &logger);

let is_scan_running = subject.scan_started_at().is_some();
assert_eq!(is_scan_running, true);
Expand All @@ -2282,13 +2297,15 @@ mod tests {
#[test]
fn pending_payable_scanner_throws_an_error_when_no_fingerprint_is_found() {
let now = SystemTime::now();
let consuming_wallet = make_paying_wallet(b"consuming_wallet");
let pending_payable_dao =
PendingPayableDaoMock::new().return_all_errorless_fingerprints_result(vec![]);
let mut pending_payable_scanner = PendingPayableScannerBuilder::new()
.pending_payable_dao(pending_payable_dao)
.build();

let result = pending_payable_scanner.begin_scan(now, None, &Logger::new("test"));
let result =
pending_payable_scanner.begin_scan(consuming_wallet, now, None, &Logger::new("test"));

let is_scan_running = pending_payable_scanner.scan_started_at().is_some();
assert_eq!(result, Err(BeginScanError::NothingToProcess));
Expand Down Expand Up @@ -2924,10 +2941,14 @@ mod tests {
let earning_wallet = make_wallet("earning");
let mut receivable_scanner = ReceivableScannerBuilder::new()
.receivable_dao(receivable_dao)
.earning_wallet(earning_wallet.clone())
.build();

let result = receivable_scanner.begin_scan(now, None, &Logger::new(test_name));
let result = receivable_scanner.begin_scan(
earning_wallet.clone(),
now,
None,
&Logger::new(test_name),
);

let is_scan_running = receivable_scanner.scan_started_at().is_some();
assert_eq!(is_scan_running, true);
Expand All @@ -2952,11 +2973,16 @@ mod tests {
let earning_wallet = make_wallet("earning");
let mut receivable_scanner = ReceivableScannerBuilder::new()
.receivable_dao(receivable_dao)
.earning_wallet(earning_wallet)
.build();
let _ = receivable_scanner.begin_scan(now, None, &Logger::new("test"));
let _ =
receivable_scanner.begin_scan(earning_wallet.clone(), now, None, &Logger::new("test"));

let result = receivable_scanner.begin_scan(SystemTime::now(), None, &Logger::new("test"));
let result = receivable_scanner.begin_scan(
earning_wallet,
SystemTime::now(),
None,
&Logger::new("test"),
);

let is_scan_running = receivable_scanner.scan_started_at().is_some();
assert_eq!(is_scan_running, true);
Expand Down Expand Up @@ -2989,12 +3015,11 @@ mod tests {
.receivable_dao(receivable_dao)
.banned_dao(banned_dao)
.payment_thresholds(payment_thresholds)
.earning_wallet(earning_wallet.clone())
.build();
let logger = Logger::new("DELINQUENCY_TEST");
let now = SystemTime::now();

let result = receivable_scanner.begin_scan(now, None, &logger);
let result = receivable_scanner.begin_scan(earning_wallet.clone(), now, None, &logger);

assert_eq!(
result,
Expand Down
Loading
Loading