Skip to content

Commit 646eac2

Browse files
bertllllBert
andauthored
GH-673: Fixing some weak points in tests (#229)
* testing_area_fixes: one test counted on a premise that could not be matched with the test tooling we had; I created a new kind and fixed the test * GH-673: making three tests into more stronger ones; these will embrace also certain use of self.handle_scan() * GH-673: first phase of smooth use of stop conditions for recorder * GH-673: first moment hitting wall hard * GH-673: StopConditions considered implemented; might change some details * GH-673: added some tests... of test code... * GH-673: finishing tests and adding required PartialEq and Eq traits to some messages * GH-673: most of things from the review addressed; preparing for reducing the Single cond, experimenting * GH-673: review answered * GH-673: adding notify later 'facelift' * GH-673: simplifying default impl for NotifyLaterHandler * GH-673: review issues are gone; I added some little refactoring for ScannerFactories in AccountantBuilder --------- Co-authored-by: Bert <[email protected]>
1 parent 908dddb commit 646eac2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+926
-515
lines changed

masq/src/commands/change_password_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use clap::{App, Arg, SubCommand};
99
use masq_lib::messages::{
1010
UiChangePasswordRequest, UiChangePasswordResponse, UiNewPasswordBroadcast,
1111
};
12-
use masq_lib::{as_any_impl, short_writeln};
12+
use masq_lib::{implement_as_any, short_writeln};
1313
#[cfg(test)]
1414
use std::any::Any;
1515
use std::io::Write;
@@ -81,7 +81,7 @@ impl Command for ChangePasswordCommand {
8181
Ok(())
8282
}
8383

84-
as_any_impl!();
84+
implement_as_any!();
8585
}
8686

8787
pub fn change_password_subcommand() -> App<'static, 'static> {

masq/src/commands/check_password_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::commands::commands_common::{
55
transaction, Command, CommandError, STANDARD_COMMAND_TIMEOUT_MILLIS,
66
};
77
use clap::{App, Arg, SubCommand};
8-
use masq_lib::as_any_impl;
8+
use masq_lib::implement_as_any;
99
use masq_lib::messages::{UiCheckPasswordRequest, UiCheckPasswordResponse};
1010
use masq_lib::short_writeln;
1111
#[cfg(test)]
@@ -52,7 +52,7 @@ impl Command for CheckPasswordCommand {
5252
Ok(())
5353
}
5454

55-
as_any_impl!();
55+
implement_as_any!();
5656
}
5757

5858
impl CheckPasswordCommand {

masq/src/commands/configuration_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::commands::commands_common::{
66
dump_parameter_line, transaction, Command, CommandError, STANDARD_COMMAND_TIMEOUT_MILLIS,
77
};
88
use clap::{App, Arg, SubCommand};
9-
use masq_lib::as_any_impl;
109
use masq_lib::constants::NODE_NOT_RUNNING_ERROR;
10+
use masq_lib::implement_as_any;
1111
use masq_lib::messages::{UiConfigurationRequest, UiConfigurationResponse};
1212
use masq_lib::short_writeln;
1313
#[cfg(test)]
@@ -65,7 +65,7 @@ impl Command for ConfigurationCommand {
6565
}
6666
}
6767

68-
as_any_impl!();
68+
implement_as_any!();
6969
}
7070

7171
impl ConfigurationCommand {

masq/src/commands/connection_status_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::commands::commands_common::{
66
transaction, Command, CommandError, STANDARD_COMMAND_TIMEOUT_MILLIS,
77
};
88
use clap::{App, SubCommand};
9-
use masq_lib::as_any_impl;
109
use masq_lib::constants::NODE_NOT_RUNNING_ERROR;
10+
use masq_lib::implement_as_any;
1111
use masq_lib::messages::{
1212
UiConnectionStage, UiConnectionStatusRequest, UiConnectionStatusResponse,
1313
};
@@ -65,7 +65,7 @@ impl Command for ConnectionStatusCommand {
6565
}
6666
}
6767

68-
as_any_impl!();
68+
implement_as_any!();
6969
}
7070

7171
impl ConnectionStatusCommand {

masq/src/commands/generate_wallets_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::commands::commands_common::{
99
};
1010
use clap::{App, Arg, SubCommand};
1111
use lazy_static::lazy_static;
12-
use masq_lib::as_any_impl;
12+
use masq_lib::implement_as_any;
1313
use masq_lib::messages::{UiGenerateSeedSpec, UiGenerateWalletsRequest, UiGenerateWalletsResponse};
1414
use masq_lib::short_writeln;
1515
use masq_lib::utils::DEFAULT_CONSUMING_DERIVATION_PATH;
@@ -168,7 +168,7 @@ impl Command for GenerateWalletsCommand {
168168
Ok(())
169169
}
170170

171-
as_any_impl!();
171+
implement_as_any!();
172172
}
173173

174174
pub fn generate_wallets_subcommand() -> App<'static, 'static> {

masq/src/commands/recover_wallets_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::commands::commands_common::{
66
};
77
use clap::{App, Arg, ArgGroup, SubCommand};
88
use itertools::{Either, Itertools};
9-
use masq_lib::as_any_impl;
9+
use masq_lib::implement_as_any;
1010
use masq_lib::messages::{UiRecoverSeedSpec, UiRecoverWalletsRequest, UiRecoverWalletsResponse};
1111
use masq_lib::short_writeln;
1212
#[cfg(test)]
@@ -121,7 +121,7 @@ impl Command for RecoverWalletsCommand {
121121
Ok(())
122122
}
123123

124-
as_any_impl!();
124+
implement_as_any!();
125125
}
126126

127127
const RECOVER_WALLETS_ABOUT: &str =

masq/src/commands/set_configuration_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::command_context::CommandContext;
22
use crate::commands::commands_common::{transaction, Command, CommandError};
33
use clap::{App, Arg, ArgGroup, SubCommand};
4-
use masq_lib::as_any_impl;
4+
use masq_lib::implement_as_any;
55
use masq_lib::messages::{UiSetConfigurationRequest, UiSetConfigurationResponse};
66
use masq_lib::shared_schema::common_validators;
77
use masq_lib::shared_schema::GAS_PRICE_HELP;
@@ -55,7 +55,7 @@ impl Command for SetConfigurationCommand {
5555
Ok(())
5656
}
5757

58-
as_any_impl!();
58+
implement_as_any!();
5959
}
6060

6161
const SET_CONFIGURATION_ABOUT: &str =

masq/src/commands/setup_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::command_context::CommandContext;
44
use crate::commands::commands_common::{transaction, Command, CommandError};
55
use crate::terminal::terminal_interface::TerminalWrapper;
66
use clap::{value_t, App, SubCommand};
7-
use masq_lib::as_any_impl;
87
use masq_lib::constants::SETUP_ERROR;
8+
use masq_lib::implement_as_any;
99
use masq_lib::messages::{
1010
UiSetupBroadcast, UiSetupInner, UiSetupRequest, UiSetupRequestValue, UiSetupResponse,
1111
};
@@ -50,7 +50,7 @@ impl Command for SetupCommand {
5050
Err(e) => Err(e),
5151
}
5252
}
53-
as_any_impl!();
53+
implement_as_any!();
5454
}
5555

5656
impl SetupCommand {

masq/src/commands/wallet_addresses_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::commands::commands_common::{
66
};
77
use clap::{App, Arg, SubCommand};
88
use masq_lib::messages::{UiWalletAddressesRequest, UiWalletAddressesResponse};
9-
use masq_lib::{as_any_impl, short_writeln};
9+
use masq_lib::{implement_as_any, short_writeln};
1010
#[cfg(test)]
1111
use std::any::Any;
1212

@@ -68,7 +68,7 @@ impl Command for WalletAddressesCommand {
6868
);
6969
Ok(())
7070
}
71-
as_any_impl!();
71+
implement_as_any!();
7272
}
7373

7474
#[cfg(test)]

masq/src/communications/broadcast_handler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use masq_lib::messages::{
1111
};
1212
use masq_lib::ui_gateway::MessageBody;
1313
use masq_lib::utils::ExpectValue;
14-
use masq_lib::{as_any_dcl, as_any_impl, short_writeln};
14+
use masq_lib::{declare_as_any, implement_as_any, short_writeln};
1515
use std::fmt::Debug;
1616
use std::io::Write;
1717
use std::thread;
@@ -22,15 +22,15 @@ use std::any::Any;
2222

2323
pub trait BroadcastHandle: Send {
2424
fn send(&self, message_body: MessageBody);
25-
as_any_dcl!();
25+
declare_as_any!();
2626
}
2727

2828
pub struct BroadcastHandleInactive;
2929

3030
impl BroadcastHandle for BroadcastHandleInactive {
3131
//simply dropped (unless we find a better use for such a message)
3232
fn send(&self, _message_body: MessageBody) {}
33-
as_any_impl!();
33+
implement_as_any!();
3434
}
3535

3636
pub struct BroadcastHandleGeneric {

0 commit comments

Comments
 (0)