Skip to content

Commit bd56d3f

Browse files
bertllllBert
and
Bert
authored
GH-747: Txn received from unknown wallets + start block set on the same db txn as where we account inward payments (#350)
* GH-554: rough infrastructure for PaymentAdjuster; almost get first round test running * GH-672: simplifying GH-554, let's go on without the Neighborhood involved for the time being * GH-672: PaymentAdjusterMock and the supertrait with ScannerEtensions implemented for a try * GH-672-with-trait-impl-and-generics: perhaps going in the right direction * GH-672-best-methodology-found: implementation works * GH-672: first version of adjustment implemented * GH-672: finished implementing the main test; not refactored yet * GH-672: payment adjuster refactored; tuning logging; but wanna master features that are missing here * GH-672: some logging integrated * GH-672: fine debug log * GH-672: interim commit * GH-672: interim commit * GH-672: another package of big changes (partly-private msgs; payment adjuster) * GH-672: decent debug log for adjusted payables * GH-672: broadening the adjustment capabilities with gas; rough framework * GH-672: savepoint; before experimenting with early gas_limit computation * GH-672: continuing in implementation of the check for gas availability. * GH-672: some renaming and moving files * GH-672: almost completed but there is a cenceptual error; maybe extra tests for BlockchainInterfaceClandestine should be made first * GH-672: last details; adding tests for untested code from BlockchainInterfaceClandestine * GH-672: almost done; some refactoring ahead * GH-672: heading to auto-review * GH-672: auto review findings * GH-672: refactored scan scheduling code * GH-672: fixing issues from the review; save point before the shift of responsibility of the estimated gas limit from BchI to Chain * GH-672: before connecting the early fetched gas price and the actual gas price used for generating hashed transactions * GH-672: logic redesigned + renaming * GH-672: I believe the first review is answered by now * GH-672: almost all the old code updated; will have to implement the transaction fee calculators * GH-672: before serious changes with PayablePaymentsAgent starts * GH-672-with-agent: saving when getting into troubles with testing * GH-672-with-agent: going in a nice direction; interim commit * GH-672-with-agent: approaching the fixture...this might work well; last vexing situations unhandled meaning there are like 8 failing tests at the moment * GH-672-with-agent: could be called roughly complete; will go with refactoring and knocking off some todos left behind me * GH-672-with-agent: interim commit * GH-672-with-agent: hopefully the last changes before a review * GH-672-with-agent: almost all what I found in my auto-review * GH-672-with-agent: refactored the structure of PayablePaymentsSetupMsg * GH-672-with-agent: formatting * GH-672-wa-no-test-hack: recorder can also record and stop the system from PartalEq missing Actor messages; two of four tests repaired * GH-672-wa-no-test-hack: hurrah, managed to get out of the trap with an agent in Actor msgs even without having to implement Debug, PartialEq and Clone a trait object...this is definitely a lighter version * GH-672-wa-no-test-hack: little modifications in comments * GH-672: first batch of fixed items from the review 3 * GH-672: another batch of fixes * GH-672: refactoring some complicated test concepts for actor_system_factory and adding one test for blockchain_bridge of that kind * GH-672: more refactoring and little changes * GH-672: fixing stuff araound blockchain_interface web3 and its initialization * GH-672: savepoint * GH-672: renaming * GH-672: almost all things done; AgentDigest fully in * GH-672: finished last few missing places * GH-672: reworking comments and found a little mistake * GH-672: match stop condition turned into easier one to use * GH-672: protected payables implemented * GH-672: until now the protected payables were implemented badly; improved design * GH-672: compiling, but many failing tests * GH-672: still fixing tests, but a lot of them passing now * GH-672: halting hard with thoughts about implementation of the build_blockcahin_agent_method * GH-672: blockchain interface onward and backwards move; messy rearrangement; wanna make a savepoint before trying cargo fix * GH-672: all tests good; saving before cargo fix * GH-672: roughly ready code; let's review now * GH-672: renaming in accountant folders * GH-672: reverting some renaming in favor of another branch taking care of this * GH-672: interim commit * GH-672: little fixes and adding more in to some null methods with todos * GH-672: polishing; savepoint before moving get_transaction_receipt to plain_rpc * GH-672: improved details * GH-747: mostly complete, one test still left to be done and some ideas about refactoring arose * GH-747: even more tests needed * GH-747: last todo knocked out * GH-747: db connection options for big_int_db_processor simplified * GH-747: better design for 'other_params()' * GH-747: alias types for easier reading * GH-672: mostly done; just a few details left * GH-672: abondoning enhancement of blockchain interface initializer...leaving as it is * GH-672: unnoticable change for the augly low level tests in actor_system_factory * GH-672: blockchain_bridge_shared_test_simplified * GH-672: ready for review 5 * Revert "GH-747: db connection options for big_int_db_processor simplified" This reverts commit e987841. * GH-747: prepared for new big redesign of the test to watch the transaction roll back at panic for a hard error * GH-747: most of this is over me * GH-747: savepoint before trying to mess with lifetimes hard * GH-747: savepoint before trying to mess with lifetimes hard * GH-747: preparing for mocking BigIntProcessor * GH-747: a lot stabilized...refactoring next?? * GH-747: found the right hierarchy in the code (redesigned to be cleaner and robust)... will have to fix a tougher test and figure out what to do with a manual Debug impl * GH-747: renaming * GH-747: hard work on creating a reliable test tool; yet more of the undone left * GH-747: I'm gonna try to make the test tool more of how an unbiased viewer would expect to see it * GH-747: tools enhanced and some little debrits cleaned up * GH-747: small corrections in text * GH-747-experiment-start-block: before trying to do 'impossible' * GH-672: interim commit * GH-672: finished review 5 * GH-672: review 6 answered * GH-672: fixes in multinode tests * GH-672: little cosmetics * GH-747-experiment-start-block * GH-747-experiment-start-block: interim commit * GH-747-experiment-start-block: since now prepared for all sorts of testing; let's roll up our sleeves * GH-747-experiment-start-block: new procedure for setting start block works first time * GH-757-experiment-start-block: turned out a good idea... completed * GH-747: a dull sketch * GH-747: for both situations, no and some transactions found, start block setting implemented * GH-747: last error handling missing - but added in * GH-747: some small changes * GH-747: working on a more convenient wrapper around the rusqlite transaction; also rephrased a big comment * GH-747: first stage of enhancing the trasnaction wrapper seems done * GH-747: better interface for wrapped transaction * GH-747: interim commit * GH-747: transaction wrapper redesigned successfuly * GH-747: didn't include these accidently * GH-747: builder implemented; interface now doesn't allow misuse of the inner tx wrapper * GH-747: few more comments knocked off * GH-747: transaction wrapper test version polishing * GH-747: new little safety feature implemented * GH-747: small improvements, still working the review * GH-747: and again small impovements, still working the review * GH-747: interim commit * GH-747: more code neatened in big_int_db_processor * GH-747: revamp in receivable (at least I think) * GH-747: revamp of bulky comments * GH-747: interim commit before a big revamp * GH-747: I lost interst in the previous thing but will do files replacement now; save point * GH-747: deleted files mistakely merged in * GH-747: finished before trying master merge * GH-747: finalizing before the review; writing better comments etc * GH-747: more text revamped * GH-747: first bunch of fixes after the 2nd review * GH-747: second big bunch * GH-747: some new minor changes * GH-747: all comments addressed * GH-747: clippy * GH-747: review 2 reaction: revamping text * GH-747: review 2 reaction: another attempt, smaller * bumping version 0.8.0 --------- Co-authored-by: Bert <[email protected]>
1 parent 99b68bf commit bd56d3f

File tree

71 files changed

+2775
-1179
lines changed

Some content is hidden

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

71 files changed

+2775
-1179
lines changed

automap/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

automap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "automap"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
55
license = "GPL-3.0-only"
66
description = "Library full of code to make routers map ports through firewalls"

dns_utility/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dns_utility/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dns_utility"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
license = "GPL-3.0-only"
55
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
66
copyright = "Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved."

masq/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "masq"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
55
license = "GPL-3.0-only"
66
description = "Reference implementation of user interface for MASQ Node"

masq/src/commands/change_password_command.rs

+2-2
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_in_trait_impl, short_writeln};
12+
use masq_lib::{as_any_ref_in_trait_impl, short_writeln};
1313
use std::io::Write;
1414

1515
#[derive(Debug, PartialEq, Eq)]
@@ -79,7 +79,7 @@ impl Command for ChangePasswordCommand {
7979
Ok(())
8080
}
8181

82-
as_any_in_trait_impl!();
82+
as_any_ref_in_trait_impl!();
8383
}
8484

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

masq/src/commands/check_password_command.rs

+2-2
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_in_trait_impl;
8+
use masq_lib::as_any_ref_in_trait_impl;
99
use masq_lib::messages::{UiCheckPasswordRequest, UiCheckPasswordResponse};
1010
use masq_lib::short_writeln;
1111
use masq_lib::utils::to_string;
@@ -51,7 +51,7 @@ impl Command for CheckPasswordCommand {
5151
Ok(())
5252
}
5353

54-
as_any_in_trait_impl!();
54+
as_any_ref_in_trait_impl!();
5555
}
5656

5757
impl CheckPasswordCommand {

masq/src/commands/configuration_command.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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_in_trait_impl;
9+
use masq_lib::as_any_ref_in_trait_impl;
1010
use masq_lib::constants::NODE_NOT_RUNNING_ERROR;
1111
use masq_lib::messages::{UiConfigurationRequest, UiConfigurationResponse};
1212
use masq_lib::short_writeln;
@@ -64,7 +64,7 @@ impl Command for ConfigurationCommand {
6464
}
6565
}
6666

67-
as_any_in_trait_impl!();
67+
as_any_ref_in_trait_impl!();
6868
}
6969

7070
impl ConfigurationCommand {

masq/src/commands/connection_status_command.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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_in_trait_impl;
9+
use masq_lib::as_any_ref_in_trait_impl;
1010
use masq_lib::constants::NODE_NOT_RUNNING_ERROR;
1111
use masq_lib::messages::{
1212
UiConnectionStage, UiConnectionStatusRequest, UiConnectionStatusResponse,
@@ -62,7 +62,7 @@ impl Command for ConnectionStatusCommand {
6262
}
6363
}
6464

65-
as_any_in_trait_impl!();
65+
as_any_ref_in_trait_impl!();
6666
}
6767

6868
impl ConnectionStatusCommand {

masq/src/commands/generate_wallets_command.rs

+2-2
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 lazy_static::lazy_static;
9-
use masq_lib::as_any_in_trait_impl;
9+
use masq_lib::as_any_ref_in_trait_impl;
1010
use masq_lib::messages::{UiGenerateSeedSpec, UiGenerateWalletsRequest, UiGenerateWalletsResponse};
1111
use masq_lib::short_writeln;
1212
use masq_lib::utils::DEFAULT_EARNING_DERIVATION_PATH;
@@ -165,7 +165,7 @@ impl Command for GenerateWalletsCommand {
165165
Ok(())
166166
}
167167

168-
as_any_in_trait_impl!();
168+
as_any_ref_in_trait_impl!();
169169
}
170170

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

masq/src/commands/recover_wallets_command.rs

+2-2
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_in_trait_impl;
9+
use masq_lib::as_any_ref_in_trait_impl;
1010
use masq_lib::messages::{UiRecoverSeedSpec, UiRecoverWalletsRequest, UiRecoverWalletsResponse};
1111
use masq_lib::short_writeln;
1212
use masq_lib::utils::to_string;
@@ -120,7 +120,7 @@ impl Command for RecoverWalletsCommand {
120120
Ok(())
121121
}
122122

123-
as_any_in_trait_impl!();
123+
as_any_ref_in_trait_impl!();
124124
}
125125

126126
const RECOVER_WALLETS_ABOUT: &str =

masq/src/commands/set_configuration_command.rs

+2-2
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_in_trait_impl;
4+
use masq_lib::as_any_ref_in_trait_impl;
55
use masq_lib::messages::{UiSetConfigurationRequest, UiSetConfigurationResponse};
66
use masq_lib::shared_schema::gas_price_arg;
77
use masq_lib::shared_schema::min_hops_arg;
@@ -53,7 +53,7 @@ impl Command for SetConfigurationCommand {
5353
Ok(())
5454
}
5555

56-
as_any_in_trait_impl!();
56+
as_any_ref_in_trait_impl!();
5757
}
5858

5959
const SET_CONFIGURATION_ABOUT: &str =

masq/src/commands/setup_command.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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_in_trait_impl;
7+
use masq_lib::as_any_ref_in_trait_impl;
88
use masq_lib::constants::SETUP_ERROR;
99
use masq_lib::messages::{
1010
UiSetupBroadcast, UiSetupInner, UiSetupRequest, UiSetupRequestValue, UiSetupResponse,
@@ -51,7 +51,7 @@ impl Command for SetupCommand {
5151
Err(e) => Err(e),
5252
}
5353
}
54-
as_any_in_trait_impl!();
54+
as_any_ref_in_trait_impl!();
5555
}
5656

5757
impl SetupCommand {

masq/src/commands/wallet_addresses_command.rs

+2-2
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_in_trait_impl, short_writeln};
9+
use masq_lib::{as_any_ref_in_trait_impl, short_writeln};
1010

1111
#[derive(Debug, PartialEq, Eq)]
1212
pub struct WalletAddressesCommand {
@@ -66,7 +66,7 @@ impl Command for WalletAddressesCommand {
6666
);
6767
Ok(())
6868
}
69-
as_any_in_trait_impl!();
69+
as_any_ref_in_trait_impl!();
7070
}
7171

7272
#[cfg(test)]

masq/src/communications/broadcast_handler.rs

+3-3
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_in_trait, as_any_in_trait_impl, short_writeln};
14+
use masq_lib::{as_any_ref_in_trait, as_any_ref_in_trait_impl, short_writeln};
1515
use std::fmt::Debug;
1616
use std::io::Write;
1717
use std::thread;
@@ -20,15 +20,15 @@ use crate::notifications::connection_change_notification::ConnectionChangeNotifi
2020

2121
pub trait BroadcastHandle: Send {
2222
fn send(&self, message_body: MessageBody);
23-
as_any_in_trait!();
23+
as_any_ref_in_trait!();
2424
}
2525

2626
pub struct BroadcastHandleInactive;
2727

2828
impl BroadcastHandle for BroadcastHandleInactive {
2929
//simply dropped (unless we find a better use for such a message)
3030
fn send(&self, _message_body: MessageBody) {}
31-
as_any_in_trait_impl!();
31+
as_any_ref_in_trait_impl!();
3232
}
3333

3434
pub struct BroadcastHandleGeneric {

masq_lib/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "masq_lib"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
55
license = "GPL-3.0-only"
66
description = "Code common to Node and masq; also, temporarily, to dns_utility"

masq_lib/src/utils.rs

+23-2
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ macro_rules! intentionally_blank {
412412
}
413413

414414
#[macro_export]
415-
macro_rules! as_any_in_trait {
415+
macro_rules! as_any_ref_in_trait {
416416
() => {
417417
#[cfg(test)]
418418
fn as_any(&self) -> &dyn std::any::Any {
@@ -423,7 +423,7 @@ macro_rules! as_any_in_trait {
423423
}
424424

425425
#[macro_export]
426-
macro_rules! as_any_in_trait_impl {
426+
macro_rules! as_any_ref_in_trait_impl {
427427
() => {
428428
#[cfg(test)]
429429
fn as_any(&self) -> &dyn std::any::Any {
@@ -432,6 +432,27 @@ macro_rules! as_any_in_trait_impl {
432432
};
433433
}
434434

435+
#[macro_export]
436+
macro_rules! as_any_mut_in_trait {
437+
() => {
438+
#[cfg(test)]
439+
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
440+
use masq_lib::intentionally_blank;
441+
intentionally_blank!()
442+
}
443+
};
444+
}
445+
446+
#[macro_export]
447+
macro_rules! as_any_mut_in_trait_impl {
448+
() => {
449+
#[cfg(test)]
450+
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
451+
self
452+
}
453+
};
454+
}
455+
435456
#[macro_export]
436457
macro_rules! test_only_use {
437458
($($use_clause: item),+) => {

multinode_integration_tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "multinode_integration_tests"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
55
license = "GPL-3.0-only"
66
description = ""

multinode_integration_tests/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use masq_lib::test_utils::utils::TEST_DEFAULT_MULTINODE_CHAIN;
77
use masq_lib::utils::NeighborhoodModeLight;
88
use node_lib::accountant::db_access_objects::payable_dao::{PayableDao, PayableDaoReal};
99
use node_lib::accountant::db_access_objects::receivable_dao::{ReceivableDao, ReceivableDaoReal};
10-
use node_lib::database::connection_wrapper::ConnectionWrapper;
1110
use node_lib::database::db_initializer::{
1211
DbInitializationConfig, DbInitializer, DbInitializerReal, ExternalData,
1312
};
13+
use node_lib::database::rusqlite_wrappers::ConnectionWrapper;
1414
use node_lib::db_config::config_dao::{ConfigDao, ConfigDaoReal};
1515
use node_lib::neighborhood::node_record::NodeRecordInner_0v1;
1616
use node_lib::neighborhood::AccessibleGossipRecord;

node/Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "node"
3-
version = "0.7.3"
3+
version = "0.8.0"
44
license = "GPL-3.0-only"
55
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
66
description = "MASQ Node is the foundation of MASQ Network, an open-source network that allows anyone to allocate spare computing resources to make the internet a free and fair place for the entire world."

node/src/accountant/db_access_objects/banned_dao.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.
22

33
use crate::accountant::db_access_objects::utils::{DaoFactoryReal, VigilantRusqliteFlatten};
4-
use crate::database::connection_wrapper::ConnectionWrapper;
4+
use crate::database::rusqlite_wrappers::ConnectionWrapper;
55
use crate::sub_lib::wallet::Wallet;
66
use lazy_static::lazy_static;
77
use rusqlite::{Error, ErrorCode, ToSql};

0 commit comments

Comments
 (0)