From 2f2dfff53d6ca27e21695f7c64ee808aa5f14f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Thu, 23 Feb 2023 10:01:46 +0100 Subject: [PATCH] Add nym prefix to a few more crates (#3092) * Add nym- prefix to execute crate * Add nym- prefix to nonexhaustive-delayqueue * Add nym- prefix to config crate * Update imports * Update more module paths * rustfmt * Add nym- prefix to statistics-common * Update explicit module paths * rustfmt --- Cargo.lock | 128 +++++++++--------- clients/client-core/Cargo.toml | 4 +- .../action_controller.rs | 2 +- clients/client-core/src/config/mod.rs | 4 +- .../src/config/persistence/key_pathfinder.rs | 2 +- clients/client-core/src/init/helpers.rs | 2 +- clients/client-core/src/init/mod.rs | 4 +- clients/credential/Cargo.toml | 2 +- clients/credential/src/main.rs | 2 +- clients/native/Cargo.toml | 2 +- clients/native/src/client/config/mod.rs | 4 +- clients/native/src/commands/init.rs | 2 +- clients/native/src/commands/mod.rs | 6 +- clients/native/src/commands/run.rs | 2 +- clients/native/src/commands/upgrade.rs | 2 +- clients/socks5/Cargo.toml | 2 +- clients/socks5/src/client/config/mod.rs | 4 +- clients/socks5/src/commands/init.rs | 2 +- clients/socks5/src/commands/mod.rs | 6 +- clients/socks5/src/commands/run.rs | 2 +- clients/socks5/src/commands/upgrade.rs | 2 +- .../client-libs/validator-client/Cargo.toml | 6 +- .../src/nyxd/fee/gas_price.rs | 2 +- .../validator-client/src/nyxd/mod.rs | 4 +- .../validator-client/src/nyxd/wallet/mod.rs | 2 +- common/config/Cargo.toml | 2 +- common/execute/Cargo.toml | 2 +- common/nonexhaustive-delayqueue/Cargo.toml | 4 +- common/statistics/Cargo.toml | 2 +- common/types/Cargo.toml | 2 +- common/types/src/account.rs | 2 +- common/types/src/currency.rs | 2 +- contracts/mixnet/Cargo.toml | 2 +- gateway/Cargo.toml | 4 +- gateway/src/commands/init.rs | 2 +- gateway/src/commands/mod.rs | 6 +- gateway/src/commands/upgrade.rs | 2 +- gateway/src/config/mod.rs | 4 +- gateway/src/node/mod.rs | 2 +- gateway/src/node/statistics/collector.rs | 2 +- gateway/src/support/config.rs | 2 +- mixnode/Cargo.toml | 4 +- mixnode/src/commands/describe.rs | 2 +- mixnode/src/commands/init.rs | 2 +- mixnode/src/commands/mod.rs | 6 +- mixnode/src/commands/node_details.rs | 2 +- mixnode/src/commands/run.rs | 2 +- mixnode/src/commands/sign.rs | 2 +- mixnode/src/commands/upgrade.rs | 2 +- mixnode/src/config/mod.rs | 6 +- mixnode/src/main.rs | 2 +- mixnode/src/node/mod.rs | 2 +- mixnode/src/node/packet_delayforwarder.rs | 2 +- nym-api/Cargo.toml | 2 +- nym-api/src/coconut/deposit.rs | 2 +- nym-api/src/coconut/mod.rs | 2 +- nym-api/src/coconut/tests.rs | 2 +- nym-api/src/main.rs | 4 +- nym-api/src/network_monitor/monitor/sender.rs | 2 +- nym-api/src/support/cli/mod.rs | 4 +- nym-api/src/support/config/mod.rs | 6 +- nym-api/src/support/nyxd/mod.rs | 2 +- nym-connect/desktop/src-tauri/Cargo.toml | 2 +- .../desktop/src-tauri/src/config/mod.rs | 6 +- nym-connect/desktop/src-tauri/src/main.rs | 2 +- nym-connect/desktop/src-tauri/src/state.rs | 2 +- nym-connect/desktop/src-tauri/src/tasks.rs | 2 +- nym-connect/mobile/src-tauri/Cargo.lock | 78 +++++------ nym-connect/mobile/src-tauri/Cargo.toml | 2 +- .../mobile/src-tauri/src/config/mod.rs | 6 +- nym-connect/mobile/src-tauri/src/lib.rs | 2 +- nym-connect/mobile/src-tauri/src/state.rs | 2 +- nym-connect/mobile/src-tauri/src/tasks.rs | 2 +- nym-wallet/Cargo.lock | 52 +++---- nym-wallet/nym-wallet-types/Cargo.toml | 2 +- nym-wallet/nym-wallet-types/src/network.rs | 2 +- nym-wallet/src-tauri/Cargo.toml | 2 +- nym-wallet/src-tauri/src/config/mod.rs | 2 +- .../src/operations/mixnet/account.rs | 2 +- nym-wallet/src-tauri/src/state.rs | 2 +- .../src-tauri/src/wallet_storage/mod.rs | 2 +- .../network-requester/Cargo.toml | 4 +- .../network-requester/src/cli/init.rs | 2 +- .../network-requester/src/cli/mod.rs | 4 +- .../network-requester/src/cli/run.rs | 2 +- .../network-requester/src/config/mod.rs | 2 +- .../network-requester/src/core.rs | 2 +- .../src/statistics/collector.rs | 18 +-- .../network-requester/src/statistics/error.rs | 2 +- .../network-statistics/Cargo.toml | 2 +- .../network-statistics/src/api/mod.rs | 2 +- .../network-statistics/src/api/routes.rs | 2 +- .../network-statistics/src/storage/mod.rs | 6 +- 93 files changed, 261 insertions(+), 261 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bea58ef887..4f8d33aacf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -680,7 +680,6 @@ name = "client-core" version = "1.1.10" dependencies = [ "async-trait", - "config", "dashmap 5.4.0", "dirs", "futures", @@ -689,8 +688,9 @@ dependencies = [ "gloo-timers", "humantime-serde", "log", - "nonexhaustive-delayqueue", + "nym-config", "nym-crypto", + "nym-nonexhaustive-delayqueue", "nym-pemstore", "nym-sphinx", "nym-task", @@ -788,19 +788,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "config" -version = "0.1.0" -dependencies = [ - "cfg-if", - "handlebars", - "log", - "nym-network-defaults", - "serde", - "toml", - "url", -] - [[package]] name = "console-api" version = "0.4.0" @@ -1009,11 +996,11 @@ dependencies = [ "bip39", "clap 4.1.4", "coconut-interface", - "config", "credential-storage", "credentials", "log", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-pemstore", @@ -1811,14 +1798,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "execute" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "explorer-api" version = "1.1.10" @@ -3238,18 +3217,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nonexhaustive-delayqueue" -version = "0.1.0" -dependencies = [ - "futures-core", - "slab", - "tokio", - "tokio-stream", - "tokio-util", - "wasm-timer", -] - [[package]] name = "ntapi" version = "0.4.0" @@ -3323,7 +3290,6 @@ dependencies = [ "coconut-bandwidth-contract-common", "coconut-dkg-common", "coconut-interface", - "config", "console-subscriber", "cosmwasm-std", "credential-storage", @@ -3343,6 +3309,7 @@ dependencies = [ "multisig-contract-common", "nym-api-requests", "nym-bin-common", + "nym-config", "nym-contracts-common", "nym-crypto", "nym-inclusion-probability", @@ -3485,7 +3452,6 @@ dependencies = [ "clap 4.1.4", "client-core", "coconut-interface", - "config", "credential-storage", "credentials", "dirs", @@ -3495,6 +3461,7 @@ dependencies = [ "lazy_static", "log", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-pemstore", @@ -3514,6 +3481,19 @@ dependencies = [ "websocket-requests", ] +[[package]] +name = "nym-config" +version = "0.1.0" +dependencies = [ + "cfg-if", + "handlebars", + "log", + "nym-network-defaults", + "serde", + "toml", + "url", +] + [[package]] name = "nym-contracts-common" version = "0.1.0" @@ -3551,6 +3531,14 @@ dependencies = [ "x25519-dalek", ] +[[package]] +name = "nym-execute" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "nym-gateway" version = "1.1.10" @@ -3563,7 +3551,6 @@ dependencies = [ "clap 4.1.4", "coconut-interface", "colored", - "config", "credentials", "dashmap 4.0.2", "dirs", @@ -3577,10 +3564,12 @@ dependencies = [ "mixnode-common", "nym-api-requests", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-pemstore", "nym-sphinx", + "nym-statistics-common", "nym-task", "nym-types", "once_cell", @@ -3589,7 +3578,6 @@ dependencies = [ "serde", "serde_json", "sqlx 0.5.13", - "statistics-common", "subtle-encoding", "thiserror", "tokio", @@ -3637,7 +3625,6 @@ dependencies = [ "bs58", "clap 4.1.4", "colored", - "config", "cupid", "dirs", "dotenv", @@ -3647,9 +3634,10 @@ dependencies = [ "log", "mixnet-client", "mixnode-common", - "nonexhaustive-delayqueue", "nym-bin-common", + "nym-config", "nym-crypto", + "nym-nonexhaustive-delayqueue", "nym-pemstore", "nym-sphinx", "nym-sphinx-params", @@ -3690,17 +3678,18 @@ dependencies = [ "async-trait", "clap 4.1.4", "client-core", - "config", "dirs", "futures", "ipnetwork 0.20.0", "lazy_static", "log", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-sdk", "nym-sphinx", + "nym-statistics-common", "nym-task", "ordered-buffer", "pretty_env_logger", @@ -3712,7 +3701,6 @@ dependencies = [ "service-providers-common", "socks5-requests", "sqlx 0.6.2", - "statistics-common", "tap", "thiserror", "tokio", @@ -3728,15 +3716,27 @@ dependencies = [ "dirs", "log", "nym-bin-common", + "nym-statistics-common", "pretty_env_logger", "rocket", "serde", "sqlx 0.5.13", - "statistics-common", "thiserror", "tokio", ] +[[package]] +name = "nym-nonexhaustive-delayqueue" +version = "0.1.0" +dependencies = [ + "futures-core", + "slab", + "tokio", + "tokio-stream", + "tokio-util", + "wasm-timer", +] + [[package]] name = "nym-outfox" version = "0.1.0" @@ -3791,7 +3791,6 @@ dependencies = [ "clap 4.1.4", "client-core", "coconut-interface", - "config", "credential-storage", "credentials", "dirs", @@ -3802,6 +3801,7 @@ dependencies = [ "log", "mobile-storage", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-pemstore", @@ -3951,6 +3951,20 @@ dependencies = [ "sphinx-packet", ] +[[package]] +name = "nym-statistics-common" +version = "1.0.1" +dependencies = [ + "async-trait", + "log", + "reqwest", + "serde", + "serde_json", + "sqlx 0.5.13", + "thiserror", + "tokio", +] + [[package]] name = "nym-task" version = "0.1.0" @@ -3983,12 +3997,12 @@ name = "nym-types" version = "1.0.0" dependencies = [ "coconut-interface", - "config", "cosmrs", "cosmwasm-std", "eyre", "itertools", "log", + "nym-config", "nym-mixnet-contract-common", "nym-vesting-contract", "nym-vesting-contract-common", @@ -4035,10 +4049,10 @@ dependencies = [ name = "nym-wallet-types" version = "1.0.0" dependencies = [ - "config", "cosmrs", "cosmwasm-std", "hex-literal", + "nym-config", "nym-mixnet-contract-common", "nym-network-defaults", "nym-types", @@ -5972,20 +5986,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "statistics-common" -version = "1.0.1" -dependencies = [ - "async-trait", - "log", - "reqwest", - "serde", - "serde_json", - "sqlx 0.5.13", - "thiserror", - "tokio", -] - [[package]] name = "stringprep" version = "0.1.2" @@ -6871,12 +6871,10 @@ dependencies = [ "coconut-dkg-common", "coconut-interface", "colored", - "config", "cosmrs", "cosmwasm-std", "cw3", "cw4", - "execute", "flate2", "futures", "group-contract-common", @@ -6884,7 +6882,9 @@ dependencies = [ "log", "multisig-contract-common", "nym-api-requests", + "nym-config", "nym-contracts-common", + "nym-execute", "nym-mixnet-contract-common", "nym-network-defaults", "nym-vesting-contract", diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index dd2a30d1b7..df20c45d98 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -24,12 +24,12 @@ tokio = { version = "1.24.1", features = ["macros"]} time = "0.3.17" # internal -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } nym-crypto = { path = "../../common/crypto" } gateway-client = { path = "../../common/client-libs/gateway-client" } #gateway-client = { path = "../../common/client-libs/gateway-client", default-features = false, features = ["wasm", "coconut"] } gateway-requests = { path = "../../gateway/gateway-requests" } -nonexhaustive-delayqueue = { path = "../../common/nonexhaustive-delayqueue" } +nym-nonexhaustive-delayqueue = { path = "../../common/nonexhaustive-delayqueue" } nym-sphinx = { path = "../../common/nymsphinx" } nym-pemstore = { path = "../../common/pemstore" } nym-topology = { path = "../../common/topology" } diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs index a812c90b92..95fd31ec01 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs @@ -6,7 +6,7 @@ use crate::client::real_messages_control::acknowledgement_control::Retransmissio use futures::channel::mpsc; use futures::StreamExt; use log::*; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey}; +use nym_nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey}; use nym_sphinx::chunking::fragment::FragmentIdentifier; use nym_sphinx::Delay as SphinxDelay; use std::collections::HashMap; diff --git a/clients/client-core/src/config/mod.rs b/clients/client-core/src/config/mod.rs index ad573c463b..a48b2b59b9 100644 --- a/clients/client-core/src/config/mod.rs +++ b/clients/client-core/src/config/mod.rs @@ -1,8 +1,8 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use config::defaults::NymNetworkDetails; -use config::{NymConfig, OptionalSet, DB_FILE_NAME}; +use nym_config::defaults::NymNetworkDetails; +use nym_config::{NymConfig, OptionalSet, DB_FILE_NAME}; use nym_sphinx::params::PacketSize; use serde::{Deserialize, Serialize}; use std::marker::PhantomData; diff --git a/clients/client-core/src/config/persistence/key_pathfinder.rs b/clients/client-core/src/config/persistence/key_pathfinder.rs index 70bfe3610f..97d5fd3727 100644 --- a/clients/client-core/src/config/persistence/key_pathfinder.rs +++ b/clients/client-core/src/config/persistence/key_pathfinder.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::config::Config; -use config::NymConfig; +use nym_config::NymConfig; use std::path::{Path, PathBuf}; #[derive(Debug)] diff --git a/clients/client-core/src/init/helpers.rs b/clients/client-core/src/init/helpers.rs index f1062c6b35..e7d03d585a 100644 --- a/clients/client-core/src/init/helpers.rs +++ b/clients/client-core/src/init/helpers.rs @@ -6,11 +6,11 @@ use crate::{ config::{persistence::key_pathfinder::ClientKeyPathfinder, Config}, error::ClientCoreError, }; -use config::NymConfig; #[cfg(target_arch = "wasm32")] use gateway_client::wasm_mockups::SigningNyxdClient; use gateway_client::GatewayClient; use gateway_requests::registration::handshake::SharedKeys; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use nym_topology::{filter::VersionFilterable, gateway}; use rand::{seq::SliceRandom, thread_rng}; diff --git a/clients/client-core/src/init/mod.rs b/clients/client-core/src/init/mod.rs index 667c5e0fa5..f99fa318c2 100644 --- a/clients/client-core/src/init/mod.rs +++ b/clients/client-core/src/init/mod.rs @@ -10,7 +10,7 @@ use rand::rngs::OsRng; use serde::Serialize; use tap::TapFallible; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::{encryption, identity}; use url::Url; @@ -182,7 +182,7 @@ pub fn get_client_address_from_stored_keys( config: &Config, ) -> Result where - T: config::NymConfig, + T: nym_config::NymConfig, { fn load_identity_keys( pathfinder: &ClientKeyPathfinder, diff --git a/clients/credential/Cargo.toml b/clients/credential/Cargo.toml index 93f80477a9..84e5bf68c6 100644 --- a/clients/credential/Cargo.toml +++ b/clients/credential/Cargo.toml @@ -16,7 +16,7 @@ url = "2.2" tokio = { version = "1.24.1", features = ["rt-multi-thread", "net", "signal", "macros"] } # async runtime coconut-interface = { path = "../../common/coconut-interface" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } credentials = { path = "../../common/credentials" } credential-storage = { path = "../../common/credential-storage" } nym-crypto = { path = "../../common/crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] } diff --git a/clients/credential/src/main.rs b/clients/credential/src/main.rs index f98409578a..50d256bf59 100644 --- a/clients/credential/src/main.rs +++ b/clients/credential/src/main.rs @@ -8,10 +8,10 @@ mod recovery_storage; mod state; use commands::*; -use config::{DATA_DIR, DB_FILE_NAME}; use error::Result; use log::*; use nym_bin_common::completions::fig_generate; +use nym_config::{DATA_DIR, DB_FILE_NAME}; use nym_network_defaults::{setup_env, NymNetworkDetails}; use std::process::exit; use std::time::{Duration, SystemTime}; diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index c007de69c1..8c98ab9487 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -37,7 +37,7 @@ tokio-tungstenite = "0.14" # websocket nym-bin-common = { path = "../../common/bin-common" } client-core = { path = "../client-core", features = ["fs-surb-storage"] } coconut-interface = { path = "../../common/coconut-interface" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } credential-storage = { path = "../../common/credential-storage" } credentials = { path = "../../common/credentials" } nym-crypto = { path = "../../common/crypto" } diff --git a/clients/native/src/client/config/mod.rs b/clients/native/src/client/config/mod.rs index d87019e735..80795ca450 100644 --- a/clients/native/src/client/config/mod.rs +++ b/clients/native/src/client/config/mod.rs @@ -3,8 +3,8 @@ use crate::client::config::template::config_template; use client_core::config::ClientCoreConfigTrait; -use config::defaults::DEFAULT_WEBSOCKET_LISTENING_PORT; -use config::{NymConfig, OptionalSet}; +use nym_config::defaults::DEFAULT_WEBSOCKET_LISTENING_PORT; +use nym_config::{NymConfig, OptionalSet}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; use std::net::{IpAddr, Ipv4Addr}; diff --git a/clients/native/src/commands/init.rs b/clients/native/src/commands/init.rs index 68b9312576..756adfa493 100644 --- a/clients/native/src/commands/init.rs +++ b/clients/native/src/commands/init.rs @@ -7,7 +7,7 @@ use crate::{ error::ClientError, }; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; diff --git a/clients/native/src/commands/mod.rs b/clients/native/src/commands/mod.rs index fee9a18339..b8c05c4cc7 100644 --- a/clients/native/src/commands/mod.rs +++ b/clients/native/src/commands/mod.rs @@ -4,10 +4,10 @@ use crate::client::config::{BaseConfig, Config}; use clap::CommandFactory; use clap::{Parser, Subcommand}; -use config::OptionalSet; use lazy_static::lazy_static; use nym_bin_common::build_information::BinaryBuildInformation; use nym_bin_common::completions::{fig_generate, ArgShell}; +use nym_config::OptionalSet; use std::error::Error; use std::net::IpAddr; @@ -88,13 +88,13 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config { BaseConfig::with_custom_nym_apis, args.nym_apis, nym_network_defaults::var_names::NYM_API, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_custom_env_ext( BaseConfig::with_custom_nyxd, args.nyxd_urls, nym_network_defaults::var_names::NYXD, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_ext( BaseConfig::with_disabled_credentials, diff --git a/clients/native/src/commands/run.rs b/clients/native/src/commands/run.rs index 0c001fc892..62ca82e4dd 100644 --- a/clients/native/src/commands/run.rs +++ b/clients/native/src/commands/run.rs @@ -11,9 +11,9 @@ use crate::{ }; use clap::Args; -use config::NymConfig; use log::*; use nym_bin_common::version_checker::is_minor_version_compatible; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; #[derive(Args, Clone)] diff --git a/clients/native/src/commands/upgrade.rs b/clients/native/src/commands/upgrade.rs index a959c2d701..97e7dddba6 100644 --- a/clients/native/src/commands/upgrade.rs +++ b/clients/native/src/commands/upgrade.rs @@ -3,8 +3,8 @@ use crate::client::config::{Config, MISSING_VALUE}; -use config::NymConfig; use nym_bin_common::version_checker::Version; +use nym_config::NymConfig; use clap::Args; use std::fmt::Display; diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 4a1d8681bd..12f84f0d06 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -30,7 +30,7 @@ url = "2.2" nym-bin-common = { path = "../../common/bin-common" } client-core = { path = "../client-core", features = ["fs-surb-storage"] } coconut-interface = { path = "../../common/coconut-interface" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } credential-storage = { path = "../../common/credential-storage", optional = true } mobile-storage = { path = "../../common/mobile-storage", optional = true } credentials = { path = "../../common/credentials" } diff --git a/clients/socks5/src/client/config/mod.rs b/clients/socks5/src/client/config/mod.rs index 79ad8e1f54..15791ba9fa 100644 --- a/clients/socks5/src/client/config/mod.rs +++ b/clients/socks5/src/client/config/mod.rs @@ -5,8 +5,8 @@ use crate::client::config::template::config_template; pub use client_core::config::Config as BaseConfig; pub use client_core::config::MISSING_VALUE; use client_core::config::{ClientCoreConfigTrait, DebugConfig}; -use config::defaults::DEFAULT_SOCKS5_LISTENING_PORT; -use config::{NymConfig, OptionalSet}; +use nym_config::defaults::DEFAULT_SOCKS5_LISTENING_PORT; +use nym_config::{NymConfig, OptionalSet}; use nym_sphinx::addressing::clients::Recipient; use serde::{Deserialize, Serialize}; use service_providers_common::interface::ProviderInterfaceVersion; diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index 8cb67c278e..2c6ae23730 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -7,7 +7,7 @@ use crate::{ error::Socks5ClientError, }; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; diff --git a/clients/socks5/src/commands/mod.rs b/clients/socks5/src/commands/mod.rs index 2fc8f508c4..9e5b903de6 100644 --- a/clients/socks5/src/commands/mod.rs +++ b/clients/socks5/src/commands/mod.rs @@ -4,10 +4,10 @@ use crate::client::config::{BaseConfig, Config}; use clap::CommandFactory; use clap::{Parser, Subcommand}; -use config::OptionalSet; use lazy_static::lazy_static; use nym_bin_common::build_information::BinaryBuildInformation; use nym_bin_common::completions::{fig_generate, ArgShell}; +use nym_config::OptionalSet; use std::error::Error; pub mod init; @@ -87,13 +87,13 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config { BaseConfig::with_custom_nym_apis, args.nym_apis, nym_network_defaults::var_names::NYM_API, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_custom_env_ext( BaseConfig::with_custom_nyxd, args.nyxd_urls, nym_network_defaults::var_names::NYXD, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_ext( BaseConfig::with_disabled_credentials, diff --git a/clients/socks5/src/commands/run.rs b/clients/socks5/src/commands/run.rs index d31388547c..6bd381b678 100644 --- a/clients/socks5/src/commands/run.rs +++ b/clients/socks5/src/commands/run.rs @@ -8,9 +8,9 @@ use crate::{ }; use clap::Args; -use config::NymConfig; use log::*; use nym_bin_common::version_checker::is_minor_version_compatible; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use nym_sphinx::addressing::clients::Recipient; diff --git a/clients/socks5/src/commands/upgrade.rs b/clients/socks5/src/commands/upgrade.rs index 25f5802102..982bae4634 100644 --- a/clients/socks5/src/commands/upgrade.rs +++ b/clients/socks5/src/commands/upgrade.rs @@ -3,8 +3,8 @@ use crate::client::config::{Config, MISSING_VALUE}; -use config::NymConfig; use nym_bin_common::version_checker::Version; +use nym_config::NymConfig; use clap::Args; use std::{fmt::Display, process}; diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 3774ba7eb7..379cf546b0 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -37,7 +37,7 @@ nym-api-requests = { path = "../../../nym-api/nym-api-requests" } # perhaps after https://github.com/cosmos/cosmos-rust/pull/97 is resolved (and tendermint-rs is updated) async-trait = { version = "0.1.51", optional = true } bip39 = { version = "1", features = ["rand"], optional = true } -config = { path = "../../config", optional = true } +nym-config = { path = "../../config", optional = true } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support", features = ["rpc", "bip32", "cosmwasm"], optional = true} cw3 = { version = "0.13.4", optional = true } cw4 = { version = "0.13.4", optional = true } @@ -46,7 +46,7 @@ flate2 = { version = "1.0.20", optional = true } sha2 = { version = "0.9.5", optional = true } itertools = { version = "0.10", optional = true } cosmwasm-std = { version = "1.0.0", optional = true } -execute = { path = "../../execute" } +nym-execute = { path = "../../execute" } [dev-dependencies] ts-rs = "6.1.2" @@ -55,7 +55,7 @@ ts-rs = "6.1.2" nyxd-client = [ "async-trait", "bip39", - "config", + "nym-config", "cosmrs", "cw3", "cw4", diff --git a/common/client-libs/validator-client/src/nyxd/fee/gas_price.rs b/common/client-libs/validator-client/src/nyxd/fee/gas_price.rs index 13cffc92fc..10ae3a7bb7 100644 --- a/common/client-libs/validator-client/src/nyxd/fee/gas_price.rs +++ b/common/client-libs/validator-client/src/nyxd/fee/gas_price.rs @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 use crate::nyxd::error::NyxdError; -use config::defaults; use cosmrs::tx::Gas; use cosmrs::Coin; use cosmwasm_std::{Decimal, Fraction, Uint128}; +use nym_config::defaults; use std::ops::Mul; use std::str::FromStr; diff --git a/common/client-libs/validator-client/src/nyxd/mod.rs b/common/client-libs/validator-client/src/nyxd/mod.rs index 3c20b2acf4..e02672682b 100644 --- a/common/client-libs/validator-client/src/nyxd/mod.rs +++ b/common/client-libs/validator-client/src/nyxd/mod.rs @@ -15,8 +15,8 @@ use cosmrs::rpc::query::Query; use cosmrs::rpc::Error as TendermintRpcError; use cosmrs::rpc::HttpClientUrl; use cosmrs::tx::Msg; -use execute::execute; use log::debug; +use nym_execute::execute; use nym_mixnet_contract_common::MixId; use nym_network_defaults::{ChainDetails, NymNetworkDetails}; use nym_vesting_contract_common::ExecuteMsg as VestingExecuteMsg; @@ -162,7 +162,7 @@ impl NyxdClient { // maybe the wallet could be made into a generic, but for now, let's just have this one implementation pub fn connect_with_signer( config: Config, - network: config::defaults::NymNetworkDetails, + network: nym_config::defaults::NymNetworkDetails, endpoint: U, signer: DirectSecp256k1HdWallet, gas_price: Option, diff --git a/common/client-libs/validator-client/src/nyxd/wallet/mod.rs b/common/client-libs/validator-client/src/nyxd/wallet/mod.rs index 30242b433f..f58d059c6d 100644 --- a/common/client-libs/validator-client/src/nyxd/wallet/mod.rs +++ b/common/client-libs/validator-client/src/nyxd/wallet/mod.rs @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 use crate::nyxd::error::NyxdError; -use config::defaults; use cosmrs::bip32::{DerivationPath, XPrv}; use cosmrs::crypto::secp256k1::{Signature, SigningKey}; use cosmrs::crypto::PublicKey; use cosmrs::tx::SignDoc; use cosmrs::{tx, AccountId}; +use nym_config::defaults; /// Derivation information required to derive a keypair and an address from a mnemonic. #[derive(Debug, Clone)] diff --git a/common/config/Cargo.toml b/common/config/Cargo.toml index 035d555765..496d483d75 100644 --- a/common/config/Cargo.toml +++ b/common/config/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "config" +name = "nym-config" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" diff --git a/common/execute/Cargo.toml b/common/execute/Cargo.toml index 551f1728fb..634737397f 100644 --- a/common/execute/Cargo.toml +++ b/common/execute/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "execute" +name = "nym-execute" version = "0.1.0" edition = "2021" diff --git a/common/nonexhaustive-delayqueue/Cargo.toml b/common/nonexhaustive-delayqueue/Cargo.toml index 9cc7a8d2a7..975eb631fe 100644 --- a/common/nonexhaustive-delayqueue/Cargo.toml +++ b/common/nonexhaustive-delayqueue/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nonexhaustive-delayqueue" +name = "nym-nonexhaustive-delayqueue" version = "0.1.0" authors = ["Jędrzej Stuczyński "] edition = "2021" @@ -19,4 +19,4 @@ rev = "b9d1a54ad514c2f230a026afe0dde341e98cd7b6" version = "0.4.4" [target."cfg(target_arch = \"wasm32\")".dependencies.futures-core] -version = "0.3.0" \ No newline at end of file +version = "0.3.0" diff --git a/common/statistics/Cargo.toml b/common/statistics/Cargo.toml index 65004dbc40..5649e22414 100644 --- a/common/statistics/Cargo.toml +++ b/common/statistics/Cargo.toml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 [package] -name = "statistics-common" +name = "nym-statistics-common" version = "1.0.1" edition = "2021" diff --git a/common/types/Cargo.toml b/common/types/Cargo.toml index 7b8ddaac39..1bdf334f42 100644 --- a/common/types/Cargo.toml +++ b/common/types/Cargo.toml @@ -27,7 +27,7 @@ validator-client = { path = "../../common/client-libs/validator-client", feature ] } nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } coconut-interface = { path = "../../common/coconut-interface" } # Used for Type conversion, can be extracted but its a lot of work nym-vesting-contract = { path = "../../contracts/vesting" } diff --git a/common/types/src/account.rs b/common/types/src/account.rs index 47c6fc0c6d..12bc12efd4 100644 --- a/common/types/src/account.rs +++ b/common/types/src/account.rs @@ -1,5 +1,5 @@ use crate::currency::{CurrencyDenom, DecCoin}; -use config::defaults::DenomDetails; +use nym_config::defaults::DenomDetails; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/common/types/src/currency.rs b/common/types/src/currency.rs index c9ba2e908b..df0a735a69 100644 --- a/common/types/src/currency.rs +++ b/common/types/src/currency.rs @@ -1,7 +1,7 @@ use crate::error::TypesError; -use config::defaults::{DenomDetails, DenomDetailsOwned, NymNetworkDetails}; use cosmwasm_std::Fraction; use cosmwasm_std::{Decimal, Uint128}; +use nym_config::defaults::{DenomDetails, DenomDetailsOwned, NymNetworkDetails}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index 7e364c873f..6533083b92 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -24,7 +24,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common", version = "0.1.0" } vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.1.0" } -#config = { path = "../../common/config"} +#nym-config = { path = "../../common/config"} cosmwasm-std = "1.0.0" cosmwasm-storage = "1.0.0" diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 60f8c4a913..6e3bb78e08 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -54,7 +54,7 @@ url = { version = "2.2", features = ["serde"] } # internal coconut-interface = { path = "../common/coconut-interface" } credentials = { path = "../common/credentials" } -config = { path = "../common/config" } +nym-config = { path = "../common/config" } nym-crypto = { path = "../common/crypto" } nym-bin-common = { path = "../common/bin-common" } gateway-requests = { path = "gateway-requests" } @@ -63,7 +63,7 @@ mixnode-common = { path = "../common/mixnode-common" } nym-network-defaults = { path = "../common/network-defaults" } nym-sphinx = { path = "../common/nymsphinx" } nym-pemstore = { path = "../common/pemstore" } -statistics-common = { path = "../common/statistics" } +nym-statistics-common = { path = "../common/statistics" } nym-api-requests = { path = "../nym-api/nym-api-requests" } nym-task = { path = "../common/task" } validator-client = { path = "../common/client-libs/validator-client", features = [ diff --git a/gateway/src/commands/init.rs b/gateway/src/commands/init.rs index 15aff4ca9b..02eefb6f69 100644 --- a/gateway/src/commands/init.rs +++ b/gateway/src/commands/init.rs @@ -7,7 +7,7 @@ use crate::{ OutputFormat, }; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::{encryption, identity}; use std::error::Error; use std::net::IpAddr; diff --git a/gateway/src/commands/mod.rs b/gateway/src/commands/mod.rs index f413314662..786b15d9c7 100644 --- a/gateway/src/commands/mod.rs +++ b/gateway/src/commands/mod.rs @@ -5,9 +5,9 @@ use crate::error::GatewayError; use crate::{config::Config, Cli}; use clap::CommandFactory; use clap::Subcommand; -use config::OptionalSet; use nym_bin_common::completions::{fig_generate, ArgShell}; use nym_bin_common::version_checker; +use nym_config::OptionalSet; use nym_network_defaults::var_names::NYXD; use nym_network_defaults::var_names::{BECH32_PREFIX, NYM_API, STATISTICS_SERVICE_DOMAIN_ADDRESS}; use std::error::Error; @@ -104,7 +104,7 @@ pub(crate) fn override_config( Config::with_custom_nym_apis, args.nym_apis, NYM_API, - config::parse_urls, + nym_config::parse_urls, ) .with_optional(Config::with_enabled_statistics, args.enabled_statistics) .with_optional_env( @@ -123,7 +123,7 @@ pub(crate) fn override_config( Config::with_custom_validator_nyxd, args.nyxd_urls, NYXD, - config::parse_urls, + nym_config::parse_urls, ) .with_optional( Config::with_only_coconut_credentials, diff --git a/gateway/src/commands/upgrade.rs b/gateway/src/commands/upgrade.rs index a77fe9ee07..e3f7e10bdf 100644 --- a/gateway/src/commands/upgrade.rs +++ b/gateway/src/commands/upgrade.rs @@ -3,8 +3,8 @@ use crate::config::{Config, MISSING_VALUE}; use clap::Args; -use config::NymConfig; use nym_bin_common::version_checker::Version; +use nym_config::NymConfig; use std::fmt::Display; use std::process; diff --git a/gateway/src/config/mod.rs b/gateway/src/config/mod.rs index f295cd1df8..2442632d59 100644 --- a/gateway/src/config/mod.rs +++ b/gateway/src/config/mod.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::config::template::config_template; -use config::defaults::{DEFAULT_CLIENT_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT}; -use config::NymConfig; +use nym_config::defaults::{DEFAULT_CLIENT_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT}; +use nym_config::NymConfig; use nym_network_defaults::mainnet::{NYM_API, NYXD_URL, STATISTICS_SERVICE_DOMAIN_ADDRESS}; use serde::{Deserialize, Serialize}; use std::net::IpAddr; diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index 3d7930bc8f..cf716d1e10 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -18,10 +18,10 @@ use log::*; use mixnet_client::forwarder::{MixForwardingSender, PacketForwarder}; use nym_crypto::asymmetric::{encryption, identity}; use nym_network_defaults::NymNetworkDetails; +use nym_statistics_common::collector::StatisticsSender; use nym_task::{TaskClient, TaskManager}; use rand::seq::SliceRandom; use rand::thread_rng; -use statistics_common::collector::StatisticsSender; use std::error::Error; use std::net::SocketAddr; use std::process; diff --git a/gateway/src/node/statistics/collector.rs b/gateway/src/node/statistics/collector.rs index 62014d0d16..4f1035d979 100644 --- a/gateway/src/node/statistics/collector.rs +++ b/gateway/src/node/statistics/collector.rs @@ -6,7 +6,7 @@ use sqlx::types::chrono::{DateTime, Utc}; use std::time::Duration; use url::Url; -use statistics_common::{ +use nym_statistics_common::{ api::build_and_send_statistics_request, collector::StatisticsCollector, error::StatsError, StatsData, StatsGatewayData, StatsMessage, }; diff --git a/gateway/src/support/config.rs b/gateway/src/support/config.rs index 90576a4d89..4a6bda91a4 100644 --- a/gateway/src/support/config.rs +++ b/gateway/src/support/config.rs @@ -4,8 +4,8 @@ use crate::commands::{override_config, OverrideConfig}; use crate::config::Config; use crate::error::GatewayError; -use config::NymConfig; use log::error; +use nym_config::NymConfig; pub(crate) fn build_config>( id: String, diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index f3056e19cd..cbe1bd77e0 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -40,11 +40,11 @@ url = { version = "2.2", features = ["serde"] } atty = "0.2" ## internal -config = { path="../common/config" } +nym-config = { path="../common/config" } nym-crypto = { path="../common/crypto" } mixnet-client = { path="../common/client-libs/mixnet-client" } mixnode-common = { path="../common/mixnode-common" } -nonexhaustive-delayqueue = { path="../common/nonexhaustive-delayqueue" } +nym-nonexhaustive-delayqueue = { path="../common/nonexhaustive-delayqueue" } nym-sphinx = { path="../common/nymsphinx" } nym-pemstore = { path = "../common/pemstore", version = "0.1.0" } nym-task = { path = "../common/task" } diff --git a/mixnode/src/commands/describe.rs b/mixnode/src/commands/describe.rs index d9cecbe410..160e5de633 100644 --- a/mixnode/src/commands/describe.rs +++ b/mixnode/src/commands/describe.rs @@ -5,7 +5,7 @@ use crate::config::Config; use crate::node::node_description::NodeDescription; use clap::Args; use colored::Colorize; -use config::NymConfig; +use nym_config::NymConfig; use std::io; use std::io::Write; diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index 4aa3f987df..9dc60f2369 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -7,7 +7,7 @@ use crate::node::MixNode; use crate::OutputFormat; use crate::{commands::override_config, config::persistence::pathfinder::MixNodePathfinder}; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::{encryption, identity}; use std::net::IpAddr; use validator_client::nyxd; diff --git a/mixnode/src/commands/mod.rs b/mixnode/src/commands/mod.rs index a3796080d6..6854595a46 100644 --- a/mixnode/src/commands/mod.rs +++ b/mixnode/src/commands/mod.rs @@ -5,10 +5,10 @@ use crate::{config::Config, Cli}; use clap::CommandFactory; use clap::Subcommand; use colored::Colorize; -use config::defaults::var_names::{BECH32_PREFIX, NYM_API}; -use config::OptionalSet; use nym_bin_common::completions::{fig_generate, ArgShell}; use nym_bin_common::version_checker; +use nym_config::defaults::var_names::{BECH32_PREFIX, NYM_API}; +use nym_config::OptionalSet; use nym_crypto::bech32_address_validation; use std::net::IpAddr; use std::process; @@ -100,7 +100,7 @@ fn override_config(mut config: Config, args: OverrideConfig) -> Config { Config::with_custom_nym_apis, args.nym_apis, NYM_API, - config::parse_urls, + nym_config::parse_urls, ) .with_optional( |cfg, wallet_address| { diff --git a/mixnode/src/commands/node_details.rs b/mixnode/src/commands/node_details.rs index 98298cea74..9f1d0745a7 100644 --- a/mixnode/src/commands/node_details.rs +++ b/mixnode/src/commands/node_details.rs @@ -5,7 +5,7 @@ use crate::config::Config; use crate::node::MixNode; use crate::OutputFormat; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; #[derive(Args)] pub(crate) struct NodeDetails { diff --git a/mixnode/src/commands/run.rs b/mixnode/src/commands/run.rs index e578c422c1..6c2509d6a7 100644 --- a/mixnode/src/commands/run.rs +++ b/mixnode/src/commands/run.rs @@ -7,7 +7,7 @@ use crate::config::Config; use crate::node::MixNode; use crate::OutputFormat; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use std::net::IpAddr; use validator_client::nyxd; diff --git a/mixnode/src/commands/sign.rs b/mixnode/src/commands/sign.rs index 8c2882872e..6c5aa74e3b 100644 --- a/mixnode/src/commands/sign.rs +++ b/mixnode/src/commands/sign.rs @@ -8,8 +8,8 @@ use crate::config::{persistence::pathfinder::MixNodePathfinder, Config}; use crate::node::MixNode; use anyhow::{anyhow, Result}; use clap::{ArgGroup, Args}; -use config::NymConfig; use log::error; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use validator_client::nyxd; diff --git a/mixnode/src/commands/upgrade.rs b/mixnode/src/commands/upgrade.rs index b69b418181..ea636cdf14 100644 --- a/mixnode/src/commands/upgrade.rs +++ b/mixnode/src/commands/upgrade.rs @@ -3,8 +3,8 @@ use crate::config::{missing_string_value, Config}; use clap::Args; -use config::NymConfig; use nym_bin_common::version_checker::Version; +use nym_config::NymConfig; use std::fmt::Display; use std::process; diff --git a/mixnode/src/config/mod.rs b/mixnode/src/config/mod.rs index 6183ba073e..85e928c902 100644 --- a/mixnode/src/config/mod.rs +++ b/mixnode/src/config/mod.rs @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use crate::config::template::config_template; -use config::defaults::mainnet::NYM_API; -use config::defaults::{ +use nym_config::defaults::mainnet::NYM_API; +use nym_config::defaults::{ DEFAULT_HTTP_API_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT, DEFAULT_VERLOC_LISTENING_PORT, }; -use config::NymConfig; +use nym_config::NymConfig; use serde::{Deserialize, Deserializer, Serialize}; use std::net::{IpAddr, SocketAddr}; use std::path::PathBuf; diff --git a/mixnode/src/main.rs b/mixnode/src/main.rs index d5bf1ed947..92b28cb6b8 100644 --- a/mixnode/src/main.rs +++ b/mixnode/src/main.rs @@ -4,7 +4,7 @@ #[macro_use] extern crate rocket; -use ::config::defaults::setup_env; +use ::nym_config::defaults::setup_env; use clap::{crate_name, crate_version, Parser, ValueEnum}; use lazy_static::lazy_static; use nym_bin_common::logging::setup_logging; diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index b2443aff71..b1113481e1 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -19,10 +19,10 @@ use crate::node::node_statistics::SharedNodeStats; use crate::node::packet_delayforwarder::{DelayForwarder, PacketDelayForwardSender}; use crate::OutputFormat; use colored::Colorize; -use config::NymConfig; use log::{error, info, warn}; use mixnode_common::verloc::{self, AtomicVerlocResult, VerlocMeasurer}; use nym_bin_common::version_checker::parse_version; +use nym_config::NymConfig; use nym_crypto::asymmetric::{encryption, identity}; use nym_task::{TaskClient, TaskManager}; use rand::seq::SliceRandom; diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index 557440301f..332d959ed6 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -4,7 +4,7 @@ use crate::node::node_statistics::UpdateSender; use futures::channel::mpsc; use futures::StreamExt; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; +use nym_nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; use nym_sphinx::forwarding::packet::MixPacket; use std::io; use tokio::time::Instant; diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 5db16a4b62..bae10eece0 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -68,7 +68,7 @@ schemars = { version = "0.8", features = ["preserve_order"] } coconut-bandwidth-contract-common = { path = "../common/cosmwasm-smart-contracts/coconut-bandwidth-contract" } coconut-dkg-common = { path = "../common/cosmwasm-smart-contracts/coconut-dkg" } coconut-interface = { path = "../common/coconut-interface" } -config = { path = "../common/config" } +nym-config = { path = "../common/config" } cosmwasm-std = "1.0.0" credential-storage = { path = "../common/credential-storage" } credentials = { path = "../common/credentials" } diff --git a/nym-api/src/coconut/deposit.rs b/nym-api/src/coconut/deposit.rs index b6b472288f..356850aebf 100644 --- a/nym-api/src/coconut/deposit.rs +++ b/nym-api/src/coconut/deposit.rs @@ -95,7 +95,7 @@ pub async fn extract_encryption_key( mod test { use super::*; use crate::coconut::tests::tx_entry_fixture; - use config::defaults::VOUCHER_INFO; + use nym_config::defaults::VOUCHER_INFO; use nymcoconut::{prepare_blind_sign, BlindSignRequest, Parameters}; use rand_07::rngs::OsRng; use std::str::FromStr; diff --git a/nym-api/src/coconut/mod.rs b/nym-api/src/coconut/mod.rs index 0751d1c3b3..265da682b7 100644 --- a/nym-api/src/coconut/mod.rs +++ b/nym-api/src/coconut/mod.rs @@ -15,7 +15,6 @@ use coconut_interface::KeyPair as CoconutKeyPair; use coconut_interface::{ Attribute, BlindSignRequest, BlindedSignature, Parameters, VerificationKey, }; -use config::defaults::NYM_API_VERSION; use credentials::coconut::params::{ NymApiCredentialEncryptionAlgorithm, NymApiCredentialHkdfAlgorithm, }; @@ -24,6 +23,7 @@ use keypair::KeyPair; use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; +use nym_config::defaults::NYM_API_VERSION; use nym_crypto::asymmetric::encryption; use nym_crypto::shared_key::new_ephemeral_shared_key; use nym_crypto::symmetric::stream_cipher; diff --git a/nym-api/src/coconut/tests.rs b/nym-api/src/coconut/tests.rs index a8168ab63d..dd83eefc9e 100644 --- a/nym-api/src/coconut/tests.rs +++ b/nym-api/src/coconut/tests.rs @@ -11,7 +11,6 @@ use coconut_bandwidth_contract_common::spend_credential::{ SpendCredential, SpendCredentialResponse, }; use coconut_interface::{hash_to_scalar, Credential, VerificationKey}; -use config::defaults::VOUCHER_INFO; use cosmwasm_std::{to_binary, Addr, CosmosMsg, Decimal, WasmMsg}; use credentials::coconut::bandwidth::BandwidthVoucher; use credentials::coconut::params::{ @@ -20,6 +19,7 @@ use credentials::coconut::params::{ use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; +use nym_config::defaults::VOUCHER_INFO; use nym_crypto::shared_key::recompute_shared_key; use nym_crypto::symmetric::stream_cipher; use nymcoconut::tests::helpers::theta_from_keys_and_attributes; diff --git a/nym-api/src/main.rs b/nym-api/src/main.rs index c950e25032..e0e862cf2d 100644 --- a/nym-api/src/main.rs +++ b/nym-api/src/main.rs @@ -11,15 +11,15 @@ use crate::support::cli::CliArgs; use crate::support::config::Config; use crate::support::storage; use crate::support::storage::NymApiStorage; -use ::config::defaults::setup_env; +use ::nym_config::defaults::setup_env; use anyhow::Result; use circulating_supply_api::cache::CirculatingSupplyCache; use clap::Parser; use coconut::dkg::controller::DkgController; -use config::NymConfig; use log::info; use node_status_api::NodeStatusCache; use nym_bin_common::logging::setup_logging; +use nym_config::NymConfig; use nym_contract_cache::cache::NymContractCache; use nym_task::TaskManager; use rand::rngs::OsRng; diff --git a/nym-api/src/network_monitor/monitor/sender.rs b/nym-api/src/network_monitor/monitor/sender.rs index 6911cd0dbb..1a58db1cae 100644 --- a/nym-api/src/network_monitor/monitor/sender.rs +++ b/nym-api/src/network_monitor/monitor/sender.rs @@ -6,7 +6,6 @@ use crate::network_monitor::monitor::gateway_clients_cache::{ }; use crate::network_monitor::monitor::gateways_pinger::GatewayPinger; use crate::network_monitor::monitor::receiver::{GatewayClientUpdate, GatewayClientUpdateSender}; -use config::defaults::REMAINING_BANDWIDTH_THRESHOLD; use credential_storage::PersistentStorage; use futures::channel::mpsc; use futures::stream::{self, FuturesUnordered, StreamExt}; @@ -15,6 +14,7 @@ use futures::{Future, Stream}; use gateway_client::error::GatewayClientError; use gateway_client::{AcknowledgementReceiver, GatewayClient, MixnetMessageReceiver}; use log::{debug, info, trace, warn}; +use nym_config::defaults::REMAINING_BANDWIDTH_THRESHOLD; use nym_crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH}; use nym_sphinx::forwarding::packet::MixPacket; use nym_task::TaskClient; diff --git a/nym-api/src/support/cli/mod.rs b/nym-api/src/support/cli/mod.rs index 3bc86cdb50..66cde03562 100644 --- a/nym-api/src/support/cli/mod.rs +++ b/nym-api/src/support/cli/mod.rs @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 use super::config::Config; -use ::config::defaults::var_names::{MIXNET_CONTRACT_ADDRESS, VESTING_CONTRACT_ADDRESS}; +use ::nym_config::defaults::var_names::{MIXNET_CONTRACT_ADDRESS, VESTING_CONTRACT_ADDRESS}; use anyhow::Result; use clap::Parser; -use config::{NymConfig, OptionalSet}; use lazy_static::lazy_static; use nym_bin_common::build_information::BinaryBuildInformation; +use nym_config::{NymConfig, OptionalSet}; use std::fs; use validator_client::nyxd; diff --git a/nym-api/src/support/config/mod.rs b/nym-api/src/support/config/mod.rs index 1b2645c393..25d949cd11 100644 --- a/nym-api/src/support/config/mod.rs +++ b/nym-api/src/support/config/mod.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use self::template::config_template; -use config::defaults::mainnet::{MIXNET_CONTRACT_ADDRESS, VESTING_CONTRACT_ADDRESS}; -use config::defaults::DEFAULT_NYM_API_PORT; -use config::NymConfig; +use nym_config::defaults::mainnet::{MIXNET_CONTRACT_ADDRESS, VESTING_CONTRACT_ADDRESS}; +use nym_config::defaults::DEFAULT_NYM_API_PORT; +use nym_config::NymConfig; use serde::{Deserialize, Serialize}; use std::path::PathBuf; use std::time::Duration; diff --git a/nym-api/src/support/nyxd/mod.rs b/nym-api/src/support/nyxd/mod.rs index c69b361c52..7d624cc03e 100644 --- a/nym-api/src/support/nyxd/mod.rs +++ b/nym-api/src/support/nyxd/mod.rs @@ -13,9 +13,9 @@ use coconut_dkg_common::{ types::{EncodedBTEPublicKeyWithProof, Epoch, EpochId}, verification_key::{ContractVKShare, VerificationKeyShare}, }; -use config::defaults::{ChainDetails, NymNetworkDetails, DEFAULT_NYM_API_PORT}; use cw3::ProposalResponse; use cw4::MemberResponse; +use nym_config::defaults::{ChainDetails, NymNetworkDetails, DEFAULT_NYM_API_PORT}; use nym_contracts_common::dealings::ContractSafeBytes; use nym_mixnet_contract_common::families::{Family, FamilyHead}; use nym_mixnet_contract_common::mixnode::MixNodeDetails; diff --git a/nym-connect/desktop/src-tauri/Cargo.toml b/nym-connect/desktop/src-tauri/Cargo.toml index 29e22ed422..92efb8b1dc 100644 --- a/nym-connect/desktop/src-tauri/Cargo.toml +++ b/nym-connect/desktop/src-tauri/Cargo.toml @@ -47,7 +47,7 @@ yaml-rust = "0.4" client-core = { path = "../../../clients/client-core" } nym-api-requests = { path = "../../../nym-api/nym-api-requests" } nym-contracts-common = { path = "../../../common/cosmwasm-smart-contracts/contracts-common"} -config-common = { path = "../../../common/config", package = "config" } +nym-config-common = { path = "../../../common/config", package = "nym-config" } nym-crypto = { path = "../../../common/crypto" } nym-bin-common = { path = "../../../common/bin-common"} nym-socks5-client = { path = "../../../clients/socks5" } diff --git a/nym-connect/desktop/src-tauri/src/config/mod.rs b/nym-connect/desktop/src-tauri/src/config/mod.rs index 4305427505..43691fb49c 100644 --- a/nym-connect/desktop/src-tauri/src/config/mod.rs +++ b/nym-connect/desktop/src-tauri/src/config/mod.rs @@ -3,7 +3,7 @@ use crate::{ state::State, }; use client_core::config::Config as BaseConfig; -use config_common::NymConfig; +use nym_config_common::NymConfig; use nym_crypto::asymmetric::identity; use nym_socks5::client::config::Config as Socks5Config; use std::path::PathBuf; @@ -124,10 +124,10 @@ pub async fn init_socks5_config(provider_address: String, chosen_gateway_id: Str log::trace!("Creating config for id: {}", id); let mut config = Config::new(id.as_str(), &provider_address); - if let Ok(raw_validators) = std::env::var(config_common::defaults::var_names::NYM_API) { + if let Ok(raw_validators) = std::env::var(nym_config_common::defaults::var_names::NYM_API) { config .get_base_mut() - .set_custom_nym_apis(config_common::parse_urls(&raw_validators)); + .set_custom_nym_apis(nym_config_common::parse_urls(&raw_validators)); } let chosen_gateway_id = identity::PublicKey::from_base58_string(chosen_gateway_id) diff --git a/nym-connect/desktop/src-tauri/src/main.rs b/nym-connect/desktop/src-tauri/src/main.rs index 3110f0c17d..76a7666406 100644 --- a/nym-connect/desktop/src-tauri/src/main.rs +++ b/nym-connect/desktop/src-tauri/src/main.rs @@ -5,7 +5,7 @@ use std::sync::Arc; -use config_common::defaults::setup_env; +use nym_config_common::defaults::setup_env; use tauri::Manager; use tokio::sync::RwLock; diff --git a/nym-connect/desktop/src-tauri/src/state.rs b/nym-connect/desktop/src-tauri/src/state.rs index 2262ca316b..6afaac0dee 100644 --- a/nym-connect/desktop/src-tauri/src/state.rs +++ b/nym-connect/desktop/src-tauri/src/state.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use ::config_common::NymConfig; +use ::nym_config_common::NymConfig; use client_core::error::ClientCoreStatusMessage; use futures::SinkExt; use tap::TapFallible; diff --git a/nym-connect/desktop/src-tauri/src/tasks.rs b/nym-connect/desktop/src-tauri/src/tasks.rs index 389ce7a733..9d9ae00c92 100644 --- a/nym-connect/desktop/src-tauri/src/tasks.rs +++ b/nym-connect/desktop/src-tauri/src/tasks.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use tap::TapFallible; use tokio::sync::RwLock; -use config_common::NymConfig; +use nym_config_common::NymConfig; use nym_socks5::client::NymClient as Socks5NymClient; use nym_socks5::client::{config::Config as Socks5Config, Socks5ControlMessageSender}; diff --git a/nym-connect/mobile/src-tauri/Cargo.lock b/nym-connect/mobile/src-tauri/Cargo.lock index 2260ee2a59..1b1d0b29e7 100644 --- a/nym-connect/mobile/src-tauri/Cargo.lock +++ b/nym-connect/mobile/src-tauri/Cargo.lock @@ -615,7 +615,6 @@ name = "client-core" version = "1.1.10" dependencies = [ "async-trait", - "config", "dashmap", "dirs", "futures", @@ -624,8 +623,9 @@ dependencies = [ "gloo-timers", "humantime-serde", "log", - "nonexhaustive-delayqueue", + "nym-config", "nym-crypto", + "nym-nonexhaustive-delayqueue", "nym-pemstore", "nym-sphinx", "nym-task", @@ -768,19 +768,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "config" -version = "0.1.0" -dependencies = [ - "cfg-if", - "handlebars", - "log", - "nym-network-defaults", - "serde", - "toml", - "url", -] - [[package]] name = "const-oid" version = "0.7.1" @@ -1648,14 +1635,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "execute" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "eyre" version = "0.6.8" @@ -3374,18 +3353,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "nonexhaustive-delayqueue" -version = "0.1.0" -dependencies = [ - "futures-core", - "slab", - "tokio", - "tokio-stream", - "tokio-util", - "wasm-timer", -] - [[package]] name = "notify-rust" version = "4.7.1" @@ -3508,6 +3475,19 @@ dependencies = [ "vergen 7.5.1", ] +[[package]] +name = "nym-config" +version = "0.1.0" +dependencies = [ + "cfg-if", + "handlebars", + "log", + "nym-network-defaults", + "serde", + "toml", + "url", +] + [[package]] name = "nym-connect" version = "1.1.9" @@ -3516,7 +3496,6 @@ dependencies = [ "bip39", "chrono", "client-core", - "config", "dirs", "eyre", "fern", @@ -3526,6 +3505,7 @@ dependencies = [ "log", "nym-api-requests", "nym-bin-common", + "nym-config", "nym-contracts-common", "nym-crypto", "nym-socks5-client", @@ -3582,6 +3562,14 @@ dependencies = [ "x25519-dalek", ] +[[package]] +name = "nym-execute" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "nym-mixnet-contract-common" version = "0.1.0" @@ -3612,6 +3600,18 @@ dependencies = [ "url", ] +[[package]] +name = "nym-nonexhaustive-delayqueue" +version = "0.1.0" +dependencies = [ + "futures-core", + "slab", + "tokio", + "tokio-stream", + "tokio-util", + "wasm-timer", +] + [[package]] name = "nym-pemstore" version = "0.1.0" @@ -3626,7 +3626,6 @@ dependencies = [ "clap", "client-core", "coconut-interface", - "config", "credentials", "dirs", "futures", @@ -3636,6 +3635,7 @@ dependencies = [ "log", "mobile-storage", "nym-bin-common", + "nym-config", "nym-crypto", "nym-network-defaults", "nym-pemstore", @@ -6768,12 +6768,10 @@ dependencies = [ "coconut-dkg-common", "coconut-interface", "colored 2.0.0", - "config", "cosmrs", "cosmwasm-std", "cw3", "cw4", - "execute", "flate2", "futures", "group-contract-common", @@ -6781,7 +6779,9 @@ dependencies = [ "log", "multisig-contract-common", "nym-api-requests", + "nym-config", "nym-contracts-common", + "nym-execute", "nym-mixnet-contract-common", "nym-network-defaults", "nym-vesting-contract", diff --git a/nym-connect/mobile/src-tauri/Cargo.toml b/nym-connect/mobile/src-tauri/Cargo.toml index f83ffd2fe5..8614dd7f0c 100644 --- a/nym-connect/mobile/src-tauri/Cargo.toml +++ b/nym-connect/mobile/src-tauri/Cargo.toml @@ -49,7 +49,7 @@ yaml-rust = "0.4" client-core = { path = "../../../clients/client-core" } nym-api-requests = { path = "../../../nym-api/nym-api-requests" } nym-contracts-common = { path = "../../../common/cosmwasm-smart-contracts/contracts-common"} -config-common = { path = "../../../common/config", package = "config" } +nym-config-common = { path = "../../../common/config", package = "nym-config" } nym-crypto = { path = "../../../common/crypto" } nym-bin-common = { path = "../../../common/bin-common"} nym-socks5-client = { path = "../../../clients/socks5", features = ["mobile"], default-features = false } diff --git a/nym-connect/mobile/src-tauri/src/config/mod.rs b/nym-connect/mobile/src-tauri/src/config/mod.rs index 9e22ea806d..c6c649ab63 100644 --- a/nym-connect/mobile/src-tauri/src/config/mod.rs +++ b/nym-connect/mobile/src-tauri/src/config/mod.rs @@ -3,7 +3,7 @@ use crate::{ state::State, }; use client_core::{client::key_manager::KeyManager, config::Config as BaseConfig}; -use config_common::NymConfig; +use nym_config_common::NymConfig; use nym_crypto::asymmetric::identity; use nym_socks5::client::config::Config as Socks5Config; use std::path::PathBuf; @@ -100,10 +100,10 @@ pub async fn init_socks5_config( log::trace!("Initialising client..."); let mut config = Config::new(SOCKS5_CONFIG_ID, &provider_address); - if let Ok(raw_validators) = std::env::var(config_common::defaults::var_names::NYM_API) { + if let Ok(raw_validators) = std::env::var(nym_config_common::defaults::var_names::NYM_API) { config .get_base_mut() - .set_custom_nym_apis(config_common::parse_urls(&raw_validators)); + .set_custom_nym_apis(nym_config_common::parse_urls(&raw_validators)); } let nym_api_endpoints = config.get_base().get_nym_api_endpoints(); diff --git a/nym-connect/mobile/src-tauri/src/lib.rs b/nym-connect/mobile/src-tauri/src/lib.rs index 95f89ebf63..5fe3ef2552 100644 --- a/nym-connect/mobile/src-tauri/src/lib.rs +++ b/nym-connect/mobile/src-tauri/src/lib.rs @@ -2,7 +2,7 @@ #![allow(dead_code)] #![allow(unused_imports)] -use config_common::defaults::setup_env; +use nym_config_common::defaults::setup_env; use std::sync::Arc; use tauri::{App, Manager}; use tokio::sync::RwLock; diff --git a/nym-connect/mobile/src-tauri/src/state.rs b/nym-connect/mobile/src-tauri/src/state.rs index e3cff0a105..730665f0dd 100644 --- a/nym-connect/mobile/src-tauri/src/state.rs +++ b/nym-connect/mobile/src-tauri/src/state.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use ::config_common::NymConfig; +use ::nym_config_common::NymConfig; use client_core::client::key_manager::KeyManager; use client_core::error::ClientCoreStatusMessage; use futures::SinkExt; diff --git a/nym-connect/mobile/src-tauri/src/tasks.rs b/nym-connect/mobile/src-tauri/src/tasks.rs index 58f7d8469f..801139e683 100644 --- a/nym-connect/mobile/src-tauri/src/tasks.rs +++ b/nym-connect/mobile/src-tauri/src/tasks.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use tap::TapFallible; use tokio::sync::RwLock; -use config_common::NymConfig; +use nym_config_common::NymConfig; use nym_socks5::client::NymClient as Socks5NymClient; use nym_socks5::client::{config::Config as Socks5Config, Socks5ControlMessageSender}; diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index d9c121dcef..081bf1c5c3 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -679,19 +679,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "config" -version = "0.1.0" -dependencies = [ - "cfg-if", - "handlebars", - "log", - "nym-network-defaults", - "serde", - "toml", - "url", -] - [[package]] name = "const-oid" version = "0.7.1" @@ -1423,14 +1410,6 @@ dependencies = [ "libc", ] -[[package]] -name = "execute" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "eyre" version = "0.6.8" @@ -2939,6 +2918,19 @@ dependencies = [ "vergen 7.5.1", ] +[[package]] +name = "nym-config" +version = "0.1.0" +dependencies = [ + "cfg-if", + "handlebars", + "log", + "nym-network-defaults", + "serde", + "toml", + "url", +] + [[package]] name = "nym-contracts-common" version = "0.1.0" @@ -2950,6 +2942,14 @@ dependencies = [ "thiserror", ] +[[package]] +name = "nym-execute" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "nym-mixnet-contract-common" version = "0.1.0" @@ -2993,12 +2993,12 @@ name = "nym-types" version = "1.0.0" dependencies = [ "coconut-interface", - "config", "cosmrs", "cosmwasm-std", "eyre", "itertools", "log", + "nym-config", "nym-mixnet-contract-common", "nym-vesting-contract", "nym-vesting-contract-common", @@ -3059,10 +3059,10 @@ dependencies = [ name = "nym-wallet-types" version = "1.0.0" dependencies = [ - "config", "cosmrs", "cosmwasm-std", "hex-literal", + "nym-config", "nym-mixnet-contract-common", "nym-network-defaults", "nym-types", @@ -3087,7 +3087,6 @@ dependencies = [ "chrono", "coconut-interface", "colored 2.0.0", - "config", "cosmrs", "cosmwasm-std", "dirs", @@ -3098,6 +3097,7 @@ dependencies = [ "itertools", "k256", "log", + "nym-config", "nym-mixnet-contract-common", "nym-types", "nym-vesting-contract", @@ -5564,12 +5564,10 @@ dependencies = [ "coconut-dkg-common", "coconut-interface", "colored 2.0.0", - "config", "cosmrs", "cosmwasm-std", "cw3", "cw4", - "execute", "flate2", "futures", "group-contract-common", @@ -5577,7 +5575,9 @@ dependencies = [ "log", "multisig-contract-common", "nym-api-requests", + "nym-config", "nym-contracts-common", + "nym-execute", "nym-mixnet-contract-common", "nym-network-defaults", "nym-vesting-contract", diff --git a/nym-wallet/nym-wallet-types/Cargo.toml b/nym-wallet/nym-wallet-types/Cargo.toml index beb4deebee..f8ebba8263 100644 --- a/nym-wallet/nym-wallet-types/Cargo.toml +++ b/nym-wallet/nym-wallet-types/Cargo.toml @@ -14,7 +14,7 @@ ts-rs = "6.1.2" cosmwasm-std = "1.0.0-beta8" cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } nym-network-defaults = { path = "../../common/network-defaults" } nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } validator-client = { path = "../../common/client-libs/validator-client", features = [ diff --git a/nym-wallet/nym-wallet-types/src/network.rs b/nym-wallet/nym-wallet-types/src/network.rs index 24daf1b02c..8a443243e7 100644 --- a/nym-wallet/nym-wallet-types/src/network.rs +++ b/nym-wallet/nym-wallet-types/src/network.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use config::defaults::{mainnet, DenomDetails, NymNetworkDetails}; +use nym_config::defaults::{mainnet, DenomDetails, NymNetworkDetails}; use nym_types::{currency::DecCoin, error::TypesError}; use serde::{Deserialize, Serialize}; use std::{fmt, ops::Not, str::FromStr}; diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 00aed29983..cc72e8812b 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -59,7 +59,7 @@ validator-client = { path = "../../common/client-libs/validator-client", feature ] } nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } coconut-interface = { path = "../../common/coconut-interface" } # Used for Type conversion, can be extracted but its a lot of work nym-vesting-contract = { path = "../../contracts/vesting" } diff --git a/nym-wallet/src-tauri/src/config/mod.rs b/nym-wallet/src-tauri/src/config/mod.rs index 545d383d0c..b1c621543a 100644 --- a/nym-wallet/src-tauri/src/config/mod.rs +++ b/nym-wallet/src-tauri/src/config/mod.rs @@ -13,7 +13,7 @@ use strum::IntoEnumIterator; use url::Url; use validator_client::nyxd::AccountId as CosmosAccountId; -use config::defaults::{DenomDetailsOwned, NymNetworkDetails, ValidatorDetails}; +use nym_config::defaults::{DenomDetailsOwned, NymNetworkDetails, ValidatorDetails}; use nym_wallet_types::network::Network as WalletNetwork; use nym_wallet_types::network_config; diff --git a/nym-wallet/src-tauri/src/operations/mixnet/account.rs b/nym-wallet/src-tauri/src/operations/mixnet/account.rs index d9f3f122d7..51c53b8f95 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/account.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/account.rs @@ -4,9 +4,9 @@ use crate::network_config; use crate::state::{WalletAccountIds, WalletState}; use crate::wallet_storage::{self, DEFAULT_LOGIN_ID}; use bip39::{Language, Mnemonic}; -use config::defaults::{NymNetworkDetails, COSMOS_DERIVATION_PATH}; use cosmrs::bip32::DerivationPath; use itertools::Itertools; +use nym_config::defaults::{NymNetworkDetails, COSMOS_DERIVATION_PATH}; use nym_types::account::{Account, AccountEntry, Balance}; use nym_wallet_types::network::Network as WalletNetwork; use rand::seq::SliceRandom; diff --git a/nym-wallet/src-tauri/src/state.rs b/nym-wallet/src-tauri/src/state.rs index 9916cf520d..ef7eaa1cb4 100644 --- a/nym-wallet/src-tauri/src/state.rs +++ b/nym-wallet/src-tauri/src/state.rs @@ -1,7 +1,7 @@ use crate::config; use crate::error::BackendError; use crate::simulate::SimulateResult; -use ::config::defaults::NymNetworkDetails; +use ::nym_config::defaults::NymNetworkDetails; use cosmwasm_std::Decimal; use itertools::Itertools; use log::warn; diff --git a/nym-wallet/src-tauri/src/wallet_storage/mod.rs b/nym-wallet/src-tauri/src/wallet_storage/mod.rs index 7bca66d01b..0db4e87e92 100644 --- a/nym-wallet/src-tauri/src/wallet_storage/mod.rs +++ b/nym-wallet/src-tauri/src/wallet_storage/mod.rs @@ -392,7 +392,7 @@ mod tests { use crate::wallet_storage::account_data::{MnemonicAccount, WalletAccount}; use super::*; - use config::defaults::COSMOS_DERIVATION_PATH; + use nym_config::defaults::COSMOS_DERIVATION_PATH; use std::str::FromStr; use tempfile::tempdir; diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index d1b0ced0d0..3fc72dca27 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -32,7 +32,7 @@ url = { workspace = true } # internal client-core = { path = "../../clients/client-core" } -config = { path = "../../common/config" } +nym-config = { path = "../../common/config" } nym-crypto = { path = "../../common/crypto" } nym-bin-common = { path = "../../common/bin-common"} nym-network-defaults = { path = "../../common/network-defaults" } @@ -42,6 +42,6 @@ ordered-buffer = {path = "../../common/socks5/ordered-buffer"} proxy-helpers = { path = "../../common/socks5/proxy-helpers" } service-providers-common = { path = "../common" } socks5-requests = { path = "../../common/socks5/requests" } -statistics-common = { path = "../../common/statistics" } +nym-statistics-common = { path = "../../common/statistics" } nym-task = { path = "../../common/task" } websocket-requests = { path = "../../clients/native/websocket-requests" } diff --git a/service-providers/network-requester/src/cli/init.rs b/service-providers/network-requester/src/cli/init.rs index fba12a7d1f..0c9907db3a 100644 --- a/service-providers/network-requester/src/cli/init.rs +++ b/service-providers/network-requester/src/cli/init.rs @@ -7,7 +7,7 @@ use crate::{ error::NetworkRequesterError, }; use clap::Args; -use config::NymConfig; +use nym_config::NymConfig; use nym_crypto::asymmetric::identity; use nym_sphinx::addressing::clients::Recipient; use serde::Serialize; diff --git a/service-providers/network-requester/src/cli/mod.rs b/service-providers/network-requester/src/cli/mod.rs index b4e576b190..e65a3d642f 100644 --- a/service-providers/network-requester/src/cli/mod.rs +++ b/service-providers/network-requester/src/cli/mod.rs @@ -68,13 +68,13 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config { BaseConfig::with_custom_nym_apis, args.nym_apis, nym_network_defaults::var_names::NYM_API, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_custom_env_ext( BaseConfig::with_custom_nyxd, args.nyxd_urls, nym_network_defaults::var_names::NYXD, - config::parse_urls, + nym_config::parse_urls, ) .with_optional_ext( BaseConfig::with_disabled_credentials, diff --git a/service-providers/network-requester/src/cli/run.rs b/service-providers/network-requester/src/cli/run.rs index d4d2a9952b..b52d804895 100644 --- a/service-providers/network-requester/src/cli/run.rs +++ b/service-providers/network-requester/src/cli/run.rs @@ -7,8 +7,8 @@ use crate::{ error::NetworkRequesterError, }; use clap::Args; -use config::NymConfig; use nym_bin_common::version_checker; +use nym_config::NymConfig; use nym_sphinx::addressing::clients::Recipient; const ENABLE_STATISTICS: &str = "enable-statistics"; diff --git a/service-providers/network-requester/src/config/mod.rs b/service-providers/network-requester/src/config/mod.rs index 1dfa767ba9..24d34455e3 100644 --- a/service-providers/network-requester/src/config/mod.rs +++ b/service-providers/network-requester/src/config/mod.rs @@ -3,7 +3,7 @@ use crate::config::template::config_template; use client_core::config::ClientCoreConfigTrait; -use config::{NymConfig, OptionalSet}; +use nym_config::{NymConfig, OptionalSet}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; use std::path::PathBuf; diff --git a/service-providers/network-requester/src/core.rs b/service-providers/network-requester/src/core.rs index a0f4ae5878..7ebf5c186a 100644 --- a/service-providers/network-requester/src/core.rs +++ b/service-providers/network-requester/src/core.rs @@ -14,6 +14,7 @@ use log::warn; use nym_bin_common::build_information::BinaryBuildInformation; use nym_sphinx::addressing::clients::Recipient; use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag; +use nym_statistics_common::collector::StatisticsSender; use nym_task::connections::LaneQueueLengths; use nym_task::{TaskClient, TaskManager}; use proxy_helpers::connection_controller::{Controller, ControllerCommand, ControllerSender}; @@ -26,7 +27,6 @@ use socks5_requests::{ ConnectRequest, ConnectionId, NetworkData, SendRequest, Socks5ProtocolVersion, Socks5ProviderRequest, Socks5Request, Socks5RequestContent, Socks5Response, }; -use statistics_common::collector::StatisticsSender; use std::path::PathBuf; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/service-providers/network-requester/src/statistics/collector.rs b/service-providers/network-requester/src/statistics/collector.rs index 989ddc5e46..9ccb18f01a 100644 --- a/service-providers/network-requester/src/statistics/collector.rs +++ b/service-providers/network-requester/src/statistics/collector.rs @@ -7,6 +7,14 @@ use crate::reply::MixnetMessage; use async_trait::async_trait; use log::*; use nym_sphinx::addressing::clients::Recipient; +use nym_statistics_common::api::{ + build_statistics_request_bytes, DEFAULT_STATISTICS_SERVICE_ADDRESS, + DEFAULT_STATISTICS_SERVICE_PORT, +}; +use nym_statistics_common::{ + collector::StatisticsCollector, error::StatsError as CommonStatsError, StatsMessage, + StatsServiceData, +}; use ordered_buffer::OrderedMessageSender; use proxy_helpers::proxy_runner::MixProxySender; use rand::RngCore; @@ -14,14 +22,6 @@ use serde::Deserialize; use service_providers_common::interface::RequestVersion; use socks5_requests::{ConnectionId, RemoteAddress, Socks5Request, Socks5RequestContent}; use sqlx::types::chrono::{DateTime, Utc}; -use statistics_common::api::{ - build_statistics_request_bytes, DEFAULT_STATISTICS_SERVICE_ADDRESS, - DEFAULT_STATISTICS_SERVICE_PORT, -}; -use statistics_common::{ - collector::StatisticsCollector, error::StatsError as CommonStatsError, StatsMessage, - StatsServiceData, -}; use std::collections::{HashMap, HashSet}; use std::sync::Arc; use std::time::Duration; @@ -147,7 +147,7 @@ impl StatisticsCollector for ServiceStatisticsCollector { .get(&requested_service) .copied() .unwrap_or(0); - statistics_common::StatsData::Service(StatsServiceData::new( + nym_statistics_common::StatsData::Service(StatsServiceData::new( requested_service, request_bytes, response_bytes, diff --git a/service-providers/network-requester/src/statistics/error.rs b/service-providers/network-requester/src/statistics/error.rs index 5ee8da773d..0795d526df 100644 --- a/service-providers/network-requester/src/statistics/error.rs +++ b/service-providers/network-requester/src/statistics/error.rs @@ -12,5 +12,5 @@ pub enum StatsError { InvalidClientAddress, #[error("Common statistics error {0}")] - CommonError(#[from] statistics_common::error::StatsError), + CommonError(#[from] nym_statistics_common::error::StatsError), } diff --git a/service-providers/network-statistics/Cargo.toml b/service-providers/network-statistics/Cargo.toml index 34d3bb3d2b..6a150d97f6 100644 --- a/service-providers/network-statistics/Cargo.toml +++ b/service-providers/network-statistics/Cargo.toml @@ -15,7 +15,7 @@ sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros" thiserror = "1" tokio = { version = "1.4", features = [ "net", "rt-multi-thread", "macros", "time" ] } nym-bin-common = { path = "../../common/bin-common"} -statistics-common = { path = "../../common/statistics" } +nym-statistics-common = { path = "../../common/statistics" } [build-dependencies] sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] } diff --git a/service-providers/network-statistics/src/api/mod.rs b/service-providers/network-statistics/src/api/mod.rs index f309976faa..151a2c744d 100644 --- a/service-providers/network-statistics/src/api/mod.rs +++ b/service-providers/network-statistics/src/api/mod.rs @@ -8,7 +8,7 @@ use crate::storage::NetworkStatisticsStorage; use error::Result; use routes::{post_all_statistics, post_statistic}; -use statistics_common::api::STATISTICS_SERVICE_VERSION; +use nym_statistics_common::api::STATISTICS_SERVICE_VERSION; mod error; mod routes; diff --git a/service-providers/network-statistics/src/api/routes.rs b/service-providers/network-statistics/src/api/routes.rs index 0a1c558128..6d36a9f909 100644 --- a/service-providers/network-statistics/src/api/routes.rs +++ b/service-providers/network-statistics/src/api/routes.rs @@ -5,7 +5,7 @@ use rocket::serde::json::Json; use rocket::State; use serde::{Deserialize, Serialize}; -use statistics_common::StatsMessage; +use nym_statistics_common::StatsMessage; use crate::api::error::Result; use crate::storage::NetworkStatisticsStorage; diff --git a/service-providers/network-statistics/src/storage/mod.rs b/service-providers/network-statistics/src/storage/mod.rs index ea468c8606..f485b08145 100644 --- a/service-providers/network-statistics/src/storage/mod.rs +++ b/service-providers/network-statistics/src/storage/mod.rs @@ -6,7 +6,7 @@ use sqlx::types::chrono::{DateTime, Utc}; use sqlx::ConnectOptions; use std::path::PathBuf; -use statistics_common::StatsMessage; +use nym_statistics_common::StatsMessage; use crate::storage::error::NetworkStatisticsStorageError; use crate::storage::manager::StorageManager; @@ -58,7 +58,7 @@ impl NetworkStatisticsStorage { .into(); for stats_data in msg.stats_data { match stats_data { - statistics_common::StatsData::Service(service_data) => { + nym_statistics_common::StatsData::Service(service_data) => { self.manager .insert_service_statistics( service_data.requested_service.clone(), @@ -69,7 +69,7 @@ impl NetworkStatisticsStorage { ) .await?; } - statistics_common::StatsData::Gateway(gateway_data) => { + nym_statistics_common::StatsData::Gateway(gateway_data) => { self.manager .insert_gateway_statistics( gateway_data.gateway_id,