Skip to content

Commit

Permalink
Little renamings (#333)
Browse files Browse the repository at this point in the history
* little renaiming

* little renaming: formatting

---------

Co-authored-by: Bert <Bert@Bert.com>
  • Loading branch information
bertllll and Bert authored Aug 24, 2023
1 parent 97dfbad commit 4bea69c
Show file tree
Hide file tree
Showing 40 changed files with 222 additions and 217 deletions.
8 changes: 4 additions & 4 deletions multinode_integration_tests/src/masq_real_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use masq_lib::constants::{CURRENT_LOGFILE_NAME, DEFAULT_UI_PORT};
use masq_lib::test_utils::utils::TEST_DEFAULT_MULTINODE_CHAIN;
use masq_lib::utils::localhost;
use masq_lib::utils::{DEFAULT_CONSUMING_DERIVATION_PATH, DEFAULT_EARNING_DERIVATION_PATH};
use node_lib::blockchain::bip32::Bip32ECKeyProvider;
use node_lib::blockchain::bip32::Bip32EncryptionKeyProvider;
use node_lib::neighborhood::DEFAULT_MIN_HOPS;
use node_lib::sub_lib::accountant::{
PaymentThresholds, DEFAULT_EARNING_WALLET, DEFAULT_PAYMENT_THRESHOLDS,
Expand Down Expand Up @@ -377,7 +377,7 @@ impl NodeStartupConfig {
EarningWalletInfo::Address(address) => Wallet::from_str(address).unwrap(),
EarningWalletInfo::DerivationPath(phrase, derivation_path) => {
let mnemonic = Mnemonic::from_phrase(phrase.as_str(), Language::English).unwrap();
let keypair = Bip32ECKeyProvider::try_from((
let keypair = Bip32EncryptionKeyProvider::try_from((
Seed::new(&mnemonic, "passphrase").as_ref(),
derivation_path.as_str(),
))
Expand All @@ -392,12 +392,12 @@ impl NodeStartupConfig {
ConsumingWalletInfo::None => None,
ConsumingWalletInfo::PrivateKey(key) => {
let key_bytes = key.from_hex::<Vec<u8>>().unwrap();
let keypair = Bip32ECKeyProvider::from_raw_secret(&key_bytes).unwrap();
let keypair = Bip32EncryptionKeyProvider::from_raw_secret(&key_bytes).unwrap();
Some(Wallet::from(keypair))
}
ConsumingWalletInfo::DerivationPath(phrase, derivation_path) => {
let mnemonic = Mnemonic::from_phrase(phrase, Language::English).unwrap();
let keypair = Bip32ECKeyProvider::try_from((
let keypair = Bip32EncryptionKeyProvider::try_from((
Seed::new(&mnemonic, "passphrase").as_ref(),
derivation_path.as_str(),
))
Expand Down
6 changes: 2 additions & 4 deletions multinode_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ use crate::masq_node::{MASQNode, MASQNodeUtils};
use crate::masq_real_node::MASQRealNode;
use masq_lib::test_utils::utils::TEST_DEFAULT_MULTINODE_CHAIN;
use masq_lib::utils::NeighborhoodModeLight;
use node_lib::accountant::database_access_objects::payable_dao::{PayableDao, PayableDaoReal};
use node_lib::accountant::database_access_objects::receivable_dao::{
ReceivableDao, ReceivableDaoReal,
};
use node_lib::accountant::db_access_objects::payable_dao::{PayableDao, PayableDaoReal};
use node_lib::accountant::db_access_objects::receivable_dao::{ReceivableDao, ReceivableDaoReal};
use node_lib::database::connection_wrapper::ConnectionWrapper;
use node_lib::database::db_initializer::{
DbInitializationConfig, DbInitializer, DbInitializerReal, ExternalData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use multinode_integration_tests_lib::utils::{
config_dao, node_chain_specific_data_directory, open_all_file_permissions, receivable_dao,
UrlHolder,
};
use node_lib::accountant::database_access_objects::dao_utils::CustomQuery;
use node_lib::accountant::db_access_objects::dao_utils::CustomQuery;
use node_lib::sub_lib::wallet::Wallet;

#[test]
Expand Down
6 changes: 3 additions & 3 deletions multinode_integration_tests/tests/bookkeeping_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use multinode_integration_tests_lib::masq_real_node::{
STANDARD_CLIENT_TIMEOUT_MILLIS,
};
use multinode_integration_tests_lib::utils::{payable_dao, receivable_dao};
use node_lib::accountant::database_access_objects::dao_utils::CustomQuery;
use node_lib::accountant::database_access_objects::payable_dao::PayableAccount;
use node_lib::accountant::database_access_objects::receivable_dao::ReceivableAccount;
use node_lib::accountant::db_access_objects::dao_utils::CustomQuery;
use node_lib::accountant::db_access_objects::payable_dao::PayableAccount;
use node_lib::accountant::db_access_objects::receivable_dao::ReceivableAccount;
use node_lib::sub_lib::wallet::Wallet;
use std::collections::HashMap;
use std::thread;
Expand Down
10 changes: 4 additions & 6 deletions multinode_integration_tests/tests/verify_bill_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ use multinode_integration_tests_lib::masq_real_node::{
use multinode_integration_tests_lib::utils::{
node_chain_specific_data_directory, open_all_file_permissions, UrlHolder,
};
use node_lib::accountant::database_access_objects::payable_dao::{PayableDao, PayableDaoReal};
use node_lib::accountant::database_access_objects::receivable_dao::{
ReceivableDao, ReceivableDaoReal,
};
use node_lib::blockchain::bip32::Bip32ECKeyProvider;
use node_lib::accountant::db_access_objects::payable_dao::{PayableDao, PayableDaoReal};
use node_lib::accountant::db_access_objects::receivable_dao::{ReceivableDao, ReceivableDaoReal};
use node_lib::blockchain::bip32::Bip32EncryptionKeyProvider;
use node_lib::blockchain::blockchain_interface::{
BlockchainInterface, BlockchainInterfaceWeb3, REQUESTS_IN_PARALLEL,
};
Expand Down Expand Up @@ -393,7 +391,7 @@ fn make_node_wallet(seed: &Seed, derivation_path: &str) -> (Wallet, String) {
let secret = extended_priv_key.secret().to_hex::<String>();

(
Wallet::from(Bip32ECKeyProvider::from_key(extended_priv_key)),
Wallet::from(Bip32EncryptionKeyProvider::from_key(extended_priv_key)),
secret,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.
use crate::accountant::database_access_objects::dao_utils::{
DaoFactoryReal, VigilantRusqliteFlatten,
};
use crate::accountant::db_access_objects::dao_utils::{DaoFactoryReal, VigilantRusqliteFlatten};
use crate::database::connection_wrapper::ConnectionWrapper;
use crate::sub_lib::wallet::Wallet;
use lazy_static::lazy_static;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::database_access_objects::payable_dao::PayableAccount;
use crate::accountant::database_access_objects::receivable_dao::ReceivableAccount;
use crate::accountant::db_access_objects::payable_dao::PayableAccount;
use crate::accountant::db_access_objects::receivable_dao::ReceivableAccount;
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::accountant::{checked_conversion, gwei_to_wei, sign_conversion};
use crate::database::connection_wrapper::ConnectionWrapper;
use crate::database::db_initializer::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_db_processor::KnownKeyVariants::{
use crate::accountant::db_big_integer::big_int_db_processor::KnownKeyVariants::{
PendingPayableRowid, WalletAddress,
};
use crate::accountant::big_int_processing::big_int_db_processor::WeiChange::{
use crate::accountant::db_big_integer::big_int_db_processor::WeiChange::{
Addition, Subtraction,
};
use crate::accountant::big_int_processing::big_int_db_processor::{
use crate::accountant::db_big_integer::big_int_db_processor::{
BigIntDbProcessor, BigIntSqlConfig, Param, SQLParamsBuilder, TableNameDAO,
};
use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::database_access_objects::dao_utils;
use crate::accountant::database_access_objects::dao_utils::{
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::accountant::db_access_objects::dao_utils;
use crate::accountant::db_access_objects::dao_utils::{
sum_i128_values_from_table, to_time_t, AssemblerFeeder, CustomQuery, DaoFactoryReal,
RangeStmConfig, TopStmConfig, VigilantRusqliteFlatten,
};
use crate::accountant::database_access_objects::payable_dao::mark_pending_payable_associated_functions::{
use crate::accountant::db_access_objects::payable_dao::mark_pending_payable_associated_functions::{
compose_case_expression, execute_command, serialize_wallets,
};
use crate::accountant::{checked_conversion, sign_conversion, PendingPayableId};
Expand Down Expand Up @@ -402,10 +402,10 @@ impl TableNameDAO for PayableDaoReal {

mod mark_pending_payable_associated_functions {
use crate::accountant::comma_joined_stringifiable;
use crate::accountant::database_access_objects::dao_utils::{
use crate::accountant::db_access_objects::dao_utils::{
update_rows_and_return_valid_count, VigilantRusqliteFlatten,
};
use crate::accountant::database_access_objects::payable_dao::PayableDaoError;
use crate::accountant::db_access_objects::payable_dao::PayableDaoError;
use crate::database::connection_wrapper::ConnectionWrapper;
use crate::sub_lib::wallet::Wallet;
use itertools::Itertools;
Expand Down Expand Up @@ -552,9 +552,9 @@ mod mark_pending_payable_associated_functions {
#[cfg(test)]
mod tests {
use super::*;
use crate::accountant::database_access_objects::dao_utils::{from_time_t, now_time_t, to_time_t};
use crate::accountant::db_access_objects::dao_utils::{from_time_t, now_time_t, to_time_t};
use crate::accountant::gwei_to_wei;
use crate::accountant::database_access_objects::payable_dao::mark_pending_payable_associated_functions::explanatory_extension;
use crate::accountant::db_access_objects::payable_dao::mark_pending_payable_associated_functions::explanatory_extension;
use crate::accountant::test_utils::{
assert_account_creation_fn_fails_on_finding_wrong_columns_and_value_types,
make_pending_payable_fingerprint,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::database_access_objects::dao_utils::{
use crate::accountant::db_access_objects::dao_utils::{
from_time_t, to_time_t, DaoFactoryReal, VigilantRusqliteFlatten,
};
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::accountant::{checked_conversion, comma_joined_stringifiable};
use crate::blockchain::blockchain_bridge::PendingPayableFingerprint;
use crate::database::connection_wrapper::ConnectionWrapper;
Expand Down Expand Up @@ -241,12 +241,12 @@ impl<'a> PendingPayableDaoReal<'a> {

#[cfg(test)]
mod tests {
use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::checked_conversion;
use crate::accountant::database_access_objects::dao_utils::from_time_t;
use crate::accountant::database_access_objects::pending_payable_dao::{
use crate::accountant::db_access_objects::dao_utils::from_time_t;
use crate::accountant::db_access_objects::pending_payable_dao::{
PendingPayableDao, PendingPayableDaoError, PendingPayableDaoReal,
};
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::blockchain::blockchain_bridge::PendingPayableFingerprint;
use crate::blockchain::test_utils::make_tx_hash;
use crate::database::connection_wrapper::ConnectionWrapperReal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_db_processor::KnownKeyVariants::WalletAddress;
use crate::accountant::big_int_processing::big_int_db_processor::WeiChange::{
Addition, Subtraction,
};
use crate::accountant::big_int_processing::big_int_db_processor::{
BigIntDbProcessor, BigIntSqlConfig, Param, SQLParamsBuilder, TableNameDAO,
};
use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::checked_conversion;
use crate::accountant::database_access_objects::dao_utils;
use crate::accountant::database_access_objects::dao_utils::{
use crate::accountant::db_access_objects::dao_utils;
use crate::accountant::db_access_objects::dao_utils::{
sum_i128_values_from_table, to_time_t, AssemblerFeeder, CustomQuery, DaoFactoryReal,
RangeStmConfig, ThresholdUtils, TopStmConfig, VigilantRusqliteFlatten,
};
use crate::accountant::database_access_objects::receivable_dao::ReceivableDaoError::RusqliteError;
use crate::accountant::db_access_objects::receivable_dao::ReceivableDaoError::RusqliteError;
use crate::accountant::db_big_integer::big_int_db_processor::KnownKeyVariants::WalletAddress;
use crate::accountant::db_big_integer::big_int_db_processor::WeiChange::{Addition, Subtraction};
use crate::accountant::db_big_integer::big_int_db_processor::{
BigIntDbProcessor, BigIntSqlConfig, Param, SQLParamsBuilder, TableNameDAO,
};
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::accountant::gwei_to_wei;
use crate::blockchain::blockchain_interface::BlockchainTransaction;
use crate::database::connection_wrapper::ConnectionWrapper;
Expand Down Expand Up @@ -413,9 +411,7 @@ impl TableNameDAO for ReceivableDaoReal {
#[cfg(test)]
mod tests {
use super::*;
use crate::accountant::database_access_objects::dao_utils::{
from_time_t, now_time_t, to_time_t,
};
use crate::accountant::db_access_objects::dao_utils::{from_time_t, now_time_t, to_time_t};
use crate::accountant::gwei_to_wei;
use crate::accountant::test_utils::{
assert_account_creation_fn_fails_on_finding_wrong_columns_and_value_types,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_divider::BigIntDivider;
use crate::accountant::checked_conversion;
use crate::accountant::database_access_objects::payable_dao::PayableDaoError;
use crate::accountant::database_access_objects::receivable_dao::ReceivableDaoError;
use crate::accountant::db_access_objects::payable_dao::PayableDaoError;
use crate::accountant::db_access_objects::receivable_dao::ReceivableDaoError;
use crate::accountant::db_big_integer::big_int_divider::BigIntDivider;
use crate::database::connection_wrapper::ConnectionWrapper;
use crate::sub_lib::wallet::Wallet;
use itertools::Either;
Expand Down Expand Up @@ -498,12 +498,12 @@ big_int_db_error_from!(PayableDaoError, ReceivableDaoError);
#[cfg(test)]
mod tests {
use super::*;
use crate::accountant::big_int_processing::big_int_db_processor::ByteMagnitude::{High, Low};
use crate::accountant::big_int_processing::big_int_db_processor::KnownKeyVariants::TestKey;
use crate::accountant::big_int_processing::big_int_db_processor::WeiChange::{
use crate::accountant::db_big_integer::big_int_db_processor::ByteMagnitude::{High, Low};
use crate::accountant::db_big_integer::big_int_db_processor::KnownKeyVariants::TestKey;
use crate::accountant::db_big_integer::big_int_db_processor::WeiChange::{
Addition, Subtraction,
};
use crate::accountant::big_int_processing::test_utils::restricted::{
use crate::accountant::db_big_integer::test_utils::restricted::{
create_new_empty_db, test_database_key,
};
use crate::database::connection_wrapper::{ConnectionWrapper, ConnectionWrapperReal};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::accountant::big_int_processing::big_int_divider::UserDefinedFunctionError::InvalidInputValue;
use crate::accountant::db_big_integer::big_int_divider::UserDefinedFunctionError::InvalidInputValue;
use crate::accountant::gwei_to_wei;
use rusqlite::functions::{Context, FunctionFlags};
use rusqlite::Connection;
Expand Down Expand Up @@ -135,7 +135,7 @@ impl Display for UserDefinedFunctionError {
#[cfg(test)]
mod tests {
use super::*;
use crate::accountant::big_int_processing::test_utils::restricted::create_new_empty_db;
use crate::accountant::db_big_integer::test_utils::restricted::create_new_empty_db;
use rusqlite::Error::SqliteFailure;
use rusqlite::ErrorCode;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

pub(in crate::accountant::big_int_processing) mod restricted {
use crate::accountant::big_int_processing::big_int_db_processor::KnownKeyVariants::TestKey;
use crate::accountant::big_int_processing::big_int_db_processor::{
pub(in crate::accountant::db_big_integer) mod restricted {
use crate::accountant::db_big_integer::big_int_db_processor::KnownKeyVariants::TestKey;
use crate::accountant::db_big_integer::big_int_db_processor::{
ExtendedParamsMarker, KnownKeyVariants,
};
use masq_lib::test_utils::utils::ensure_node_home_directory_exists;
Expand Down
4 changes: 2 additions & 2 deletions node/src/accountant/financials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
}

pub(in crate::accountant) mod visibility_restricted_module {
use crate::accountant::database_access_objects::dao_utils::CustomQuery;
use crate::accountant::db_access_objects::dao_utils::CustomQuery;
use crate::accountant::financials::{fits_in_0_to_i64max_for_u64, OPCODE_FINANCIALS};
use masq_lib::constants::{
REQUEST_WITH_MUTUALLY_EXCLUSIVE_PARAMS, REQUEST_WITH_NO_VALUES, VALUE_EXCEEDS_ALLOWED_LIMIT,
Expand Down Expand Up @@ -111,7 +111,7 @@ pub(in crate::accountant) mod visibility_restricted_module {
#[cfg(test)]
mod tests {
use super::visibility_restricted_module::check_query_is_within_tech_limits;
use crate::accountant::database_access_objects::dao_utils::CustomQuery;
use crate::accountant::db_access_objects::dao_utils::CustomQuery;
use crate::accountant::financials::fits_in_0_to_i64max_for_u64;
use masq_lib::constants::VALUE_EXCEEDS_ALLOWED_LIMIT;
use masq_lib::messages::TopRecordsOrdering::Age;
Expand Down
24 changes: 11 additions & 13 deletions node/src/accountant/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

pub mod big_int_processing;
pub mod database_access_objects;
pub mod db_access_objects;
pub mod db_big_integer;
pub mod financials;
pub mod scanners;

Expand All @@ -18,16 +18,14 @@ use masq_lib::messages::{
};
use masq_lib::ui_gateway::{MessageBody, MessagePath};

use crate::accountant::database_access_objects::dao_utils::{
use crate::accountant::db_access_objects::dao_utils::{
remap_payable_accounts, remap_receivable_accounts, CustomQuery, DaoFactoryReal,
};
use crate::accountant::database_access_objects::payable_dao::{
use crate::accountant::db_access_objects::payable_dao::{
PayableAccount, PayableDao, PayableDaoError,
};
use crate::accountant::database_access_objects::pending_payable_dao::PendingPayableDao;
use crate::accountant::database_access_objects::receivable_dao::{
ReceivableDao, ReceivableDaoError,
};
use crate::accountant::db_access_objects::pending_payable_dao::PendingPayableDao;
use crate::accountant::db_access_objects::receivable_dao::{ReceivableDao, ReceivableDaoError};
use crate::accountant::financials::visibility_restricted_module::{
check_query_is_within_tech_limits, financials_entry_check,
};
Expand Down Expand Up @@ -1003,13 +1001,13 @@ pub mod check_sqlite_fns {
#[cfg(test)]
mod tests {
use super::*;
use crate::accountant::database_access_objects::dao_utils::from_time_t;
use crate::accountant::database_access_objects::dao_utils::{to_time_t, CustomQuery};
use crate::accountant::database_access_objects::payable_dao::{
use crate::accountant::db_access_objects::dao_utils::from_time_t;
use crate::accountant::db_access_objects::dao_utils::{to_time_t, CustomQuery};
use crate::accountant::db_access_objects::payable_dao::{
PayableAccount, PayableDaoError, PayableDaoFactory, PendingPayable,
};
use crate::accountant::database_access_objects::pending_payable_dao::PendingPayableDaoError;
use crate::accountant::database_access_objects::receivable_dao::ReceivableAccount;
use crate::accountant::db_access_objects::pending_payable_dao::PendingPayableDaoError;
use crate::accountant::db_access_objects::receivable_dao::ReceivableAccount;
use crate::accountant::scanners::{BeginScanError, NullScanner, ScannerMock};
use crate::accountant::test_utils::DaoWithDestination::{
ForAccountantBody, ForPayableScanner, ForPendingPayableScanner, ForReceivableScanner,
Expand Down
Loading

0 comments on commit 4bea69c

Please sign in to comment.