diff --git a/Cargo.lock b/Cargo.lock index 221d61b181..0dcda65a7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -698,7 +698,6 @@ dependencies = [ "async-trait", "client-connections", "config", - "crypto", "dashmap 5.4.0", "dirs", "futures", @@ -708,8 +707,9 @@ dependencies = [ "humantime-serde", "log", "nonexhaustive-delayqueue", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -753,10 +753,10 @@ dependencies = [ name = "coconut-dkg-common" version = "0.1.0" dependencies = [ - "contracts-common", "cosmwasm-std", "cw-utils", "multisig-contract-common", + "nym-contracts-common", "schemars", "serde", ] @@ -875,19 +875,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" -[[package]] -name = "contracts-common" -version = "0.1.0" -dependencies = [ - "bs58", - "cosmwasm-std", - "dkg", - "schemars", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cookie" version = "0.16.2" @@ -1052,11 +1039,11 @@ dependencies = [ "config", "credential-storage", "credentials", - "crypto", "log", "logging", "network-defaults", - "pemstore", + "nym-crypto", + "nym-pemstore", "rand 0.7.3", "serde", "thiserror", @@ -1083,8 +1070,8 @@ dependencies = [ "bls12_381 0.5.0", "coconut-interface", "cosmrs", - "crypto", "nym-api-requests", + "nym-crypto", "rand 0.7.3", "thiserror", "validator-client", @@ -1246,31 +1233,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto" -version = "0.1.0" -dependencies = [ - "aes 0.8.2", - "blake3", - "bs58", - "cipher 0.4.3", - "ctr 0.9.2", - "digest 0.10.6", - "ed25519-dalek", - "generic-array 0.14.6", - "hkdf 0.12.3", - "hmac 0.12.1", - "nymsphinx-types", - "pemstore", - "rand 0.7.3", - "rand_chacha 0.2.2", - "serde", - "serde_bytes", - "subtle-encoding", - "thiserror", - "x25519-dalek", -] - [[package]] name = "crypto-bigint" version = "0.3.2" @@ -1666,7 +1628,7 @@ dependencies = [ "ff 0.11.1", "group 0.11.0", "lazy_static", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -1889,7 +1851,6 @@ version = "1.1.9" dependencies = [ "chrono", "clap 4.1.4", - "contracts-common", "dotenv", "humantime-serde", "isocountry", @@ -1897,8 +1858,9 @@ dependencies = [ "log", "logging", "maxminddb", - "mixnet-contract-common", "network-defaults", + "nym-contracts-common", + "nym-mixnet-contract-common", "okapi", "pretty_env_logger", "rand 0.8.5", @@ -2158,15 +2120,15 @@ dependencies = [ "coconut-interface", "credential-storage", "credentials", - "crypto", "futures", "gateway-requests", "getrandom 0.2.8", "log", "mobile-storage", "network-defaults", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "task", @@ -2190,11 +2152,11 @@ dependencies = [ "bs58", "coconut-interface", "credentials", - "crypto", "futures", "log", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -3216,35 +3178,16 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "mixnet-contract-common" -version = "0.1.0" -dependencies = [ - "bs58", - "contracts-common", - "cosmwasm-std", - "humantime-serde", - "log", - "rand_chacha 0.3.1", - "schemars", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "time 0.3.17", - "ts-rs", -] - [[package]] name = "mixnode-common" version = "0.1.0" dependencies = [ "bytes", - "crypto", "futures", "humantime-serde", "log", "network-defaults", + "nym-crypto", "nymsphinx-acknowledgements", "nymsphinx-addressing", "nymsphinx-forwarding", @@ -3439,11 +3382,9 @@ dependencies = [ "coconut-interface", "config", "console-subscriber", - "contracts-common", "cosmwasm-std", "credential-storage", "credentials", - "crypto", "cw-utils", "cw3", "cw4", @@ -3458,13 +3399,16 @@ dependencies = [ "lazy_static", "log", "logging", - "mixnet-contract-common", "multisig-contract-common", "nym-api-requests", + "nym-contracts-common", + "nym-crypto", + "nym-mixnet-contract-common", + "nym-pemstore", + "nym-vesting-contract-common", "nymcoconut", "nymsphinx", "okapi", - "pemstore", "pin-project", "pretty_env_logger", "rand 0.7.3", @@ -3488,7 +3432,6 @@ dependencies = [ "url", "validator-client", "version-checker", - "vesting-contract-common", ] [[package]] @@ -3500,7 +3443,7 @@ dependencies = [ "cosmrs", "cosmwasm-std", "getset", - "mixnet-contract-common", + "nym-mixnet-contract-common", "schemars", "serde", "ts-rs", @@ -3564,9 +3507,10 @@ dependencies = [ "humantime-serde", "k256", "log", - "mixnet-contract-common", "multisig-contract-common", "network-defaults", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", "rand 0.6.5", "serde", "serde_json", @@ -3576,7 +3520,6 @@ dependencies = [ "toml", "url", "validator-client", - "vesting-contract-common", ] [[package]] @@ -3592,7 +3535,6 @@ dependencies = [ "config", "credential-storage", "credentials", - "crypto", "dirs", "futures", "gateway-client", @@ -3601,8 +3543,9 @@ dependencies = [ "log", "logging", "network-defaults", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "pretty_env_logger", "rand 0.7.3", "serde", @@ -3619,6 +3562,44 @@ dependencies = [ "websocket-requests", ] +[[package]] +name = "nym-contracts-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "dkg", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "nym-crypto" +version = "0.1.0" +dependencies = [ + "aes 0.8.2", + "blake3", + "bs58", + "cipher 0.4.3", + "ctr 0.9.2", + "digest 0.10.6", + "ed25519-dalek", + "generic-array 0.14.6", + "hkdf 0.12.3", + "hmac 0.12.1", + "nym-pemstore", + "nymsphinx-types", + "rand 0.7.3", + "rand_chacha 0.2.2", + "serde", + "serde_bytes", + "subtle-encoding", + "thiserror", + "x25519-dalek", +] + [[package]] name = "nym-gateway" version = "1.1.9" @@ -3635,7 +3616,6 @@ dependencies = [ "completions", "config", "credentials", - "crypto", "dashmap 4.0.2", "dirs", "dotenv", @@ -3649,10 +3629,11 @@ dependencies = [ "mixnode-common", "network-defaults", "nym-api-requests", + "nym-crypto", + "nym-pemstore", "nym-types", "nymsphinx", "once_cell", - "pemstore", "pretty_env_logger", "rand 0.7.3", "serde", @@ -3671,6 +3652,25 @@ dependencies = [ "version-checker", ] +[[package]] +name = "nym-mixnet-contract-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "humantime-serde", + "log", + "nym-contracts-common", + "rand_chacha 0.3.1", + "schemars", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "time 0.3.17", + "ts-rs", +] + [[package]] name = "nym-mixnode" version = "1.1.10" @@ -3683,7 +3683,6 @@ dependencies = [ "colored", "completions", "config", - "crypto", "cupid", "dirs", "dotenv", @@ -3695,11 +3694,12 @@ dependencies = [ "mixnet-client", "mixnode-common", "nonexhaustive-delayqueue", + "nym-crypto", + "nym-pemstore", "nym-types", "nymsphinx", "nymsphinx-params", "nymsphinx-types", - "pemstore", "pretty_env_logger", "rand 0.7.3", "rocket", @@ -3782,19 +3782,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "nym-pemstore" +version = "0.1.0" +dependencies = [ + "pem", +] + [[package]] name = "nym-sdk" version = "0.1.0" dependencies = [ "client-connections", "client-core", - "crypto", "futures", "gateway-client", "gateway-requests", "log", "logging", "network-defaults", + "nym-crypto", "nymsphinx", "pretty_env_logger", "rand 0.7.3", @@ -3820,7 +3827,6 @@ dependencies = [ "config", "credential-storage", "credentials", - "crypto", "dirs", "futures", "gateway-client", @@ -3830,9 +3836,10 @@ dependencies = [ "logging", "mobile-storage", "network-defaults", + "nym-crypto", + "nym-pemstore", "nymsphinx", "ordered-buffer", - "pemstore", "pin-project", "pretty_env_logger", "proxy-helpers", @@ -3862,7 +3869,9 @@ dependencies = [ "eyre", "itertools", "log", - "mixnet-contract-common", + "nym-mixnet-contract-common", + "nym-vesting-contract", + "nym-vesting-contract-common", "reqwest", "schemars", "serde", @@ -3873,8 +3882,33 @@ dependencies = [ "ts-rs", "url", "validator-client", - "vesting-contract", - "vesting-contract-common", +] + +[[package]] +name = "nym-vesting-contract" +version = "1.1.3" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", + "schemars", + "serde", + "thiserror", + "vergen 5.1.17", +] + +[[package]] +name = "nym-vesting-contract-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "nym-contracts-common", + "nym-mixnet-contract-common", + "schemars", + "serde", + "ts-rs", ] [[package]] @@ -3885,16 +3919,16 @@ dependencies = [ "cosmrs", "cosmwasm-std", "hex-literal", - "mixnet-contract-common", "network-defaults", + "nym-mixnet-contract-common", "nym-types", + "nym-vesting-contract", + "nym-vesting-contract-common", "serde", "serde_json", "strum 0.23.0", "ts-rs", "validator-client", - "vesting-contract", - "vesting-contract-common", ] [[package]] @@ -3911,7 +3945,7 @@ dependencies = [ "getrandom 0.2.8", "group 0.11.0", "itertools", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -3924,8 +3958,8 @@ dependencies = [ name = "nymsphinx" version = "0.1.0" dependencies = [ - "crypto", - "mixnet-contract-common", + "nym-crypto", + "nym-mixnet-contract-common", "nymsphinx-acknowledgements", "nymsphinx-addressing", "nymsphinx-anonymous-replies", @@ -3946,11 +3980,11 @@ dependencies = [ name = "nymsphinx-acknowledgements" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", + "nym-pemstore", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", - "pemstore", "rand 0.7.3", "thiserror", "topology", @@ -3960,7 +3994,7 @@ dependencies = [ name = "nymsphinx-addressing" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-types", "rand 0.7.3", "serde", @@ -3972,7 +4006,7 @@ name = "nymsphinx-anonymous-replies" version = "0.1.0" dependencies = [ "bs58", - "crypto", + "nym-crypto", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", @@ -3999,7 +4033,7 @@ dependencies = [ name = "nymsphinx-cover" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-acknowledgements", "nymsphinx-addressing", "nymsphinx-chunking", @@ -4035,7 +4069,7 @@ dependencies = [ name = "nymsphinx-params" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-types", "thiserror", ] @@ -4290,13 +4324,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pemstore" -version = "0.1.0" -dependencies = [ - "pem", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -6503,9 +6530,9 @@ name = "topology" version = "0.1.0" dependencies = [ "bs58", - "crypto", "log", - "mixnet-contract-common", + "nym-crypto", + "nym-mixnet-contract-common", "nymsphinx-addressing", "nymsphinx-types", "rand 0.7.3", @@ -6658,13 +6685,13 @@ name = "ts-rs-cli" version = "0.1.0" dependencies = [ "anyhow", - "mixnet-contract-common", "nym-api-requests", + "nym-mixnet-contract-common", "nym-types", + "nym-vesting-contract-common", "nym-wallet-types", "ts-rs", "validator-client", - "vesting-contract-common", "walkdir", ] @@ -6879,7 +6906,6 @@ dependencies = [ "coconut-interface", "colored", "config", - "contracts-common", "cosmrs", "cosmwasm-std", "cw3", @@ -6890,10 +6916,13 @@ dependencies = [ "group-contract-common", "itertools", "log", - "mixnet-contract-common", "multisig-contract-common", "network-defaults", "nym-api-requests", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract", + "nym-vesting-contract-common", "prost 0.10.4", "reqwest", "serde", @@ -6903,8 +6932,6 @@ dependencies = [ "tokio", "ts-rs", "url", - "vesting-contract", - "vesting-contract-common", ] [[package]] @@ -6966,33 +6993,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vesting-contract" -version = "1.1.3" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "cw-storage-plus", - "mixnet-contract-common", - "schemars", - "serde", - "thiserror", - "vergen 5.1.17", - "vesting-contract-common", -] - -[[package]] -name = "vesting-contract-common" -version = "0.1.0" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "mixnet-contract-common", - "schemars", - "serde", - "ts-rs", -] - [[package]] name = "walkdir" version = "2.3.2" diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index 5196587ba7..d168b659ac 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -26,13 +26,13 @@ time = "0.3.17" # internal config = { path = "../../common/config" } client-connections = { path = "../../common/client-connections" } -crypto = { path = "../../common/crypto" } +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" } nymsphinx = { path = "../../common/nymsphinx" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } topology = { path = "../../common/topology" } validator-client = { path = "../../common/client-libs/validator-client", default-features = false } task = { path = "../../common/task" } diff --git a/clients/client-core/src/client/base_client/mod.rs b/clients/client-core/src/client/base_client/mod.rs index e6316942fc..ba9e4e8d66 100644 --- a/clients/client-core/src/client/base_client/mod.rs +++ b/clients/client-core/src/client/base_client/mod.rs @@ -22,7 +22,6 @@ use crate::config::{Config, DebugConfig, GatewayEndpointConfig}; use crate::error::ClientCoreError; use crate::spawn_future; use client_connections::{ConnectionCommandReceiver, ConnectionCommandSender, LaneQueueLengths}; -use crypto::asymmetric::{encryption, identity}; use futures::channel::mpsc; use gateway_client::bandwidth::BandwidthController; #[cfg(target_arch = "wasm32")] @@ -32,6 +31,7 @@ use gateway_client::{ MixnetMessageSender, }; use log::{debug, info}; +use nym_crypto::asymmetric::{encryption, identity}; use nymsphinx::acknowledgements::AckKey; use nymsphinx::addressing::clients::Recipient; use nymsphinx::addressing::nodes::NodeIdentity; diff --git a/clients/client-core/src/client/key_manager.rs b/clients/client-core/src/client/key_manager.rs index da0b9f5cbf..daf71f4679 100644 --- a/clients/client-core/src/client/key_manager.rs +++ b/clients/client-core/src/client/key_manager.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use crate::config::persistence::key_pathfinder::ClientKeyPathfinder; -use crypto::asymmetric::{encryption, identity}; use gateway_requests::registration::handshake::SharedKeys; use log::*; +use nym_crypto::asymmetric::{encryption, identity}; use nymsphinx::acknowledgements::AckKey; use rand::{CryptoRng, RngCore}; use std::io; @@ -72,17 +72,17 @@ impl KeyManager { /// Loads previously stored client keys from the disk. fn load_client_keys(client_pathfinder: &ClientKeyPathfinder) -> io::Result { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( client_pathfinder.private_identity_key().to_owned(), client_pathfinder.public_identity_key().to_owned(), ))?; let encryption_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( client_pathfinder.private_encryption_key().to_owned(), client_pathfinder.public_encryption_key().to_owned(), ))?; - let ack_key: AckKey = pemstore::load_key(client_pathfinder.ack_key())?; + let ack_key: AckKey = nym_pemstore::load_key(client_pathfinder.ack_key())?; Ok(KeyManager { identity_keypair: Arc::new(identity_keypair), @@ -98,7 +98,7 @@ impl KeyManager { let mut key_manager = Self::load_client_keys(client_pathfinder)?; let gateway_shared_key: SharedKeys = - pemstore::load_key(client_pathfinder.gateway_shared_key())?; + nym_pemstore::load_key(client_pathfinder.gateway_shared_key())?; key_manager.gateway_shared_key = Some(Arc::new(gateway_shared_key)); @@ -113,7 +113,7 @@ impl KeyManager { let mut key_manager = Self::load_client_keys(client_pathfinder)?; let gateway_shared_key: Result = - pemstore::load_key(client_pathfinder.gateway_shared_key()); + nym_pemstore::load_key(client_pathfinder.gateway_shared_key()); // It's ok if the gateway key was not found let gateway_shared_key = match gateway_shared_key { @@ -132,27 +132,27 @@ impl KeyManager { // it is done so for the consistency sake so that you wouldn't require an rng instance // during `load_keys` to generate the said key. pub fn store_keys(&self, client_pathfinder: &ClientKeyPathfinder) -> io::Result<()> { - pemstore::store_keypair( + nym_pemstore::store_keypair( self.identity_keypair.as_ref(), - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( client_pathfinder.private_identity_key().to_owned(), client_pathfinder.public_identity_key().to_owned(), ), )?; - pemstore::store_keypair( + nym_pemstore::store_keypair( self.encryption_keypair.as_ref(), - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( client_pathfinder.private_encryption_key().to_owned(), client_pathfinder.public_encryption_key().to_owned(), ), )?; - pemstore::store_key(self.ack_key.as_ref(), client_pathfinder.ack_key())?; + nym_pemstore::store_key(self.ack_key.as_ref(), client_pathfinder.ack_key())?; match self.gateway_shared_key.as_ref() { None => debug!("No gateway shared key available to store!"), Some(gate_key) => { - pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? + nym_pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? } } @@ -168,7 +168,7 @@ impl KeyManager { )) } Some(gate_key) => { - pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? + nym_pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? } } diff --git a/clients/client-core/src/client/received_buffer.rs b/clients/client-core/src/client/received_buffer.rs index afafec44ca..e80540c386 100644 --- a/clients/client-core/src/client/received_buffer.rs +++ b/clients/client-core/src/client/received_buffer.rs @@ -4,13 +4,13 @@ use crate::client::replies::reply_controller::ReplyControllerSender; use crate::client::replies::reply_storage::SentReplyKeys; use crate::spawn_future; -use crypto::asymmetric::encryption; -use crypto::Digest; use futures::channel::mpsc; use futures::lock::Mutex; use futures::StreamExt; use gateway_client::MixnetMessageReceiver; use log::*; +use nym_crypto::asymmetric::encryption; +use nym_crypto::Digest; use nymsphinx::anonymous_replies::requests::{ RepliableMessage, RepliableMessageContent, ReplyMessage, ReplyMessageContent, }; diff --git a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs index 8b7271ed93..db039adb82 100644 --- a/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs +++ b/clients/client-core/src/client/replies/reply_storage/backend/fs_backend/models.rs @@ -3,8 +3,8 @@ use crate::client::replies::reply_storage::backend::fs_backend::error::StorageError; use crate::client::replies::reply_storage::key_storage::UsedReplyKey; -use crypto::generic_array::typenum::Unsigned; -use crypto::Digest; +use nym_crypto::generic_array::typenum::Unsigned; +use nym_crypto::Digest; use nymsphinx::addressing::clients::{Recipient, RecipientBytes}; use nymsphinx::anonymous_replies::encryption_key::EncryptionKeyDigest; use nymsphinx::anonymous_replies::requests::{AnonymousSenderTag, SENDER_TAG_SIZE}; diff --git a/clients/client-core/src/error.rs b/clients/client-core/src/error.rs index de08bb3f20..b5f176e818 100644 --- a/clients/client-core/src/error.rs +++ b/clients/client-core/src/error.rs @@ -1,8 +1,8 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity::Ed25519RecoveryError; use gateway_client::error::GatewayClientError; +use nym_crypto::asymmetric::identity::Ed25519RecoveryError; use topology::NymTopologyError; use validator_client::ValidatorClientError; diff --git a/clients/client-core/src/init/helpers.rs b/clients/client-core/src/init/helpers.rs index 546c207ac5..2ad70c4d98 100644 --- a/clients/client-core/src/init/helpers.rs +++ b/clients/client-core/src/init/helpers.rs @@ -7,11 +7,11 @@ use crate::{ error::ClientCoreError, }; use config::NymConfig; -use crypto::asymmetric::identity; #[cfg(target_arch = "wasm32")] use gateway_client::wasm_mockups::SigningNyxdClient; use gateway_client::GatewayClient; use gateway_requests::registration::handshake::SharedKeys; +use nym_crypto::asymmetric::identity; use rand::{seq::SliceRandom, thread_rng}; use std::{sync::Arc, time::Duration}; use tap::TapFallible; diff --git a/clients/client-core/src/init/mod.rs b/clients/client-core/src/init/mod.rs index e236bd588b..27e25d4972 100644 --- a/clients/client-core/src/init/mod.rs +++ b/clients/client-core/src/init/mod.rs @@ -11,7 +11,7 @@ use serde::Serialize; use tap::TapFallible; use config::NymConfig; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; use url::Url; use crate::client::key_manager::KeyManager; @@ -188,7 +188,7 @@ where pathfinder: &ClientKeyPathfinder, ) -> Result { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -200,7 +200,7 @@ where pathfinder: &ClientKeyPathfinder, ) -> Result { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/clients/credential/Cargo.toml b/clients/credential/Cargo.toml index 0245e34571..a693c20d5a 100644 --- a/clients/credential/Cargo.toml +++ b/clients/credential/Cargo.toml @@ -20,9 +20,9 @@ config = { path = "../../common/config" } completions = { path = "../../common/completions" } credentials = { path = "../../common/credentials" } credential-storage = { path = "../../common/credential-storage" } -crypto = { path = "../../common/crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] } +nym-crypto = { path = "../../common/crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] } logging = { path = "../../common/logging"} network-defaults = { path = "../../common/network-defaults" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] } diff --git a/clients/credential/src/commands.rs b/clients/credential/src/commands.rs index 60fa6bae5e..7cd3831e3a 100644 --- a/clients/credential/src/commands.rs +++ b/clients/credential/src/commands.rs @@ -12,8 +12,8 @@ use credential_storage::storage::Storage; use credential_storage::PersistentStorage; use credentials::coconut::bandwidth::{BandwidthVoucher, TOTAL_ATTRIBUTES}; use credentials::coconut::utils::obtain_aggregate_signature; -use crypto::asymmetric::{encryption, identity}; use network_defaults::VOUCHER_INFO; +use nym_crypto::asymmetric::{encryption, identity}; use validator_client::nyxd::traits::DkgQueryClient; use validator_client::nyxd::tx::Hash; use validator_client::nyxd::CosmWasmClient; diff --git a/clients/credential/src/error.rs b/clients/credential/src/error.rs index 804182a3c5..b6d1c3c1d4 100644 --- a/clients/credential/src/error.rs +++ b/clients/credential/src/error.rs @@ -6,8 +6,8 @@ use thiserror::Error; use credential_storage::error::StorageError; use credentials::error::Error as CredentialError; -use crypto::asymmetric::encryption::KeyRecoveryError; -use crypto::asymmetric::identity::Ed25519RecoveryError; +use nym_crypto::asymmetric::encryption::KeyRecoveryError; +use nym_crypto::asymmetric::identity::Ed25519RecoveryError; use validator_client::nyxd::error::NyxdError; use validator_client::ValidatorClientError; diff --git a/clients/credential/src/state.rs b/clients/credential/src/state.rs index 2b2cd7a01e..6a0ec4253f 100644 --- a/clients/credential/src/state.rs +++ b/clients/credential/src/state.rs @@ -4,7 +4,7 @@ use coconut_interface::Parameters; use credentials::coconut::bandwidth::BandwidthVoucher; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; pub(crate) struct KeyPair { pub public_key: String, diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index df2f9dad8d..ed7227bf02 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -42,13 +42,13 @@ config = { path = "../../common/config" } completions = { path = "../../common/completions" } credential-storage = { path = "../../common/credential-storage" } credentials = { path = "../../common/credentials" } -crypto = { path = "../../common/crypto" } +nym-crypto = { path = "../../common/crypto" } logging = { path = "../../common/logging"} gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } nymsphinx = { path = "../../common/nymsphinx" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } task = { path = "../../common/task" } topology = { path = "../../common/topology" } validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] } diff --git a/clients/native/src/commands/init.rs b/clients/native/src/commands/init.rs index ec5283e211..8d6a0b5229 100644 --- a/clients/native/src/commands/init.rs +++ b/clients/native/src/commands/init.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::Args; use config::NymConfig; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nymsphinx::addressing::clients::Recipient; use serde::Serialize; use std::fmt::Display; diff --git a/clients/native/src/commands/run.rs b/clients/native/src/commands/run.rs index 80b89fec1c..f6c377a8ba 100644 --- a/clients/native/src/commands/run.rs +++ b/clients/native/src/commands/run.rs @@ -12,8 +12,8 @@ use crate::{ use clap::Args; use config::NymConfig; -use crypto::asymmetric::identity; use log::*; +use nym_crypto::asymmetric::identity; use version_checker::is_minor_version_compatible; #[derive(Args, Clone)] diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 49bbc93119..397bba0f8f 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -36,14 +36,14 @@ completions = { path = "../../common/completions" } credential-storage = { path = "../../common/credential-storage", optional = true } mobile-storage = { path = "../../common/mobile-storage", optional = true } credentials = { path = "../../common/credentials" } -crypto = { path = "../../common/crypto" } +nym-crypto = { path = "../../common/crypto" } logging = { path = "../../common/logging"} gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } nymsphinx = { path = "../../common/nymsphinx" } ordered-buffer = { path = "../../common/socks5/ordered-buffer" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } proxy-helpers = { path = "../../common/socks5/proxy-helpers" } service-providers-common = { path = "../../service-providers/common" } socks5-requests = { path = "../../common/socks5/requests" } diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index 2bd0296f42..c2c4747c89 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::Args; use config::NymConfig; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nymsphinx::addressing::clients::Recipient; use serde::Serialize; use std::fmt::Display; diff --git a/clients/socks5/src/commands/run.rs b/clients/socks5/src/commands/run.rs index 9303a77abb..ddf4ffcf62 100644 --- a/clients/socks5/src/commands/run.rs +++ b/clients/socks5/src/commands/run.rs @@ -9,8 +9,8 @@ use crate::{ use clap::Args; use config::NymConfig; -use crypto::asymmetric::identity; use log::*; +use nym_crypto::asymmetric::identity; use nymsphinx::addressing::clients::Recipient; use version_checker::is_minor_version_compatible; diff --git a/clients/webassembly/Cargo.toml b/clients/webassembly/Cargo.toml index 2ef2e30e02..852ee3bebc 100644 --- a/clients/webassembly/Cargo.toml +++ b/clients/webassembly/Cargo.toml @@ -34,7 +34,7 @@ client-core = { path = "../client-core", default-features = false, features = [" client-connections = { path = "../../common/client-connections" } coconut-interface = { path = "../../common/coconut-interface" } credentials = { path = "../../common/credentials" } -crypto = { path = "../../common/crypto" } +nym-crypto = { path = "../../common/crypto" } nymsphinx = { path = "../../common/nymsphinx" } topology = { path = "../../common/topology" } gateway-client = { path = "../../common/client-libs/gateway-client", default-features = false, features = ["wasm"] } diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index 97014fc999..dca0679f07 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -20,11 +20,11 @@ tokio = { version = "1.24.1", features = ["macros"] } # internal coconut-interface = { path = "../../coconut-interface" } credentials = { path = "../../credentials" } -crypto = { path = "../../crypto" } +nym-crypto = { path = "../../crypto" } gateway-requests = { path = "../../../gateway/gateway-requests" } network-defaults = { path = "../../network-defaults" } nymsphinx = { path = "../../nymsphinx" } -pemstore = { path = "../../pemstore" } +nym-pemstore = { path = "../../pemstore" } validator-client = { path = "../validator-client" } task = { path = "../../task" } serde = { version = "1.0", features = ["derive"]} diff --git a/common/client-libs/gateway-client/src/client.rs b/common/client-libs/gateway-client/src/client.rs index e88a08de53..b89111256e 100644 --- a/common/client-libs/gateway-client/src/client.rs +++ b/common/client-libs/gateway-client/src/client.rs @@ -10,7 +10,6 @@ pub use crate::packet_router::{ use crate::socket_state::{PartiallyDelegated, SocketState}; use crate::{cleanup_socket_message, try_decrypt_binary_message}; use coconut_interface::Credential; -use crypto::asymmetric::identity; use futures::{SinkExt, StreamExt}; use gateway_requests::authentication::encrypted_address::EncryptedAddressBytes; use gateway_requests::iv::IV; @@ -18,6 +17,7 @@ use gateway_requests::registration::handshake::{client_handshake, SharedKeys}; use gateway_requests::{BinaryRequest, ClientControlRequest, ServerResponse, PROTOCOL_VERSION}; use log::*; use network_defaults::{REMAINING_BANDWIDTH_THRESHOLD, TOKENS_TO_BURN}; +use nym_crypto::asymmetric::identity; use nymsphinx::forwarding::packet::MixPacket; use rand::rngs::OsRng; use std::convert::TryFrom; diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 0ed9f3e17a..f708d02554 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -12,13 +12,13 @@ base64 = "0.13" colored = "2.0" coconut-dkg-common = { path = "../../cosmwasm-smart-contracts/coconut-dkg" } -contracts-common = { path = "../../cosmwasm-smart-contracts/contracts-common" } -mixnet-contract-common = { path= "../../cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path= "../../cosmwasm-smart-contracts/vesting-contract" } +nym-contracts-common = { path = "../../cosmwasm-smart-contracts/contracts-common" } +nym-mixnet-contract-common = { path= "../../cosmwasm-smart-contracts/mixnet-contract" } +nym-vesting-contract-common = { path= "../../cosmwasm-smart-contracts/vesting-contract" } coconut-bandwidth-contract-common = { path= "../../cosmwasm-smart-contracts/coconut-bandwidth-contract" } multisig-contract-common = { path = "../../cosmwasm-smart-contracts/multisig-contract" } group-contract-common = { path = "../../cosmwasm-smart-contracts/group-contract" } -vesting-contract = { path = "../../../contracts/vesting" } +nym-vesting-contract = { path = "../../../contracts/vesting" } serde = { version = "1", features = ["derive"] } serde_json = "1" reqwest = { version = "0.11", features = ["json"] } diff --git a/common/client-libs/validator-client/src/client.rs b/common/client-libs/validator-client/src/client.rs index 2cead1efd6..a474af73da 100644 --- a/common/client-libs/validator-client/src/client.rs +++ b/common/client-libs/validator-client/src/client.rs @@ -4,9 +4,6 @@ use crate::{nym_api, ValidatorClientError}; use coconut_dkg_common::types::NodeIndex; use coconut_interface::VerificationKey; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::MixId; -use mixnet_contract_common::{GatewayBond, IdentityKeyRef}; use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; @@ -14,6 +11,9 @@ use nym_api_requests::models::{ GatewayCoreStatusResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse, RewardEstimationResponse, StakeSaturationResponse, }; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::MixId; +use nym_mixnet_contract_common::{GatewayBond, IdentityKeyRef}; #[cfg(feature = "nyxd-client")] use crate::nyxd::traits::{DkgQueryClient, MixnetQueryClient, MultisigQueryClient}; @@ -30,17 +30,17 @@ use coconut_interface::Base58; #[cfg(feature = "nyxd-client")] use cw3::ProposalResponse; #[cfg(feature = "nyxd-client")] -use mixnet_contract_common::{ +use network_defaults::NymNetworkDetails; +#[cfg(feature = "nyxd-client")] +use nym_api_requests::models::MixNodeBondAnnotated; +#[cfg(feature = "nyxd-client")] +use nym_mixnet_contract_common::{ families::{Family, FamilyHead}, mixnode::MixNodeBond, pending_events::{PendingEpochEvent, PendingIntervalEvent}, Delegation, IdentityKey, RewardedSetNodeStatus, UnbondedMixnode, }; #[cfg(feature = "nyxd-client")] -use network_defaults::NymNetworkDetails; -#[cfg(feature = "nyxd-client")] -use nym_api_requests::models::MixNodeBondAnnotated; -#[cfg(feature = "nyxd-client")] use std::str::FromStr; use url::Url; diff --git a/common/client-libs/validator-client/src/nym_api/mod.rs b/common/client-libs/validator-client/src/nym_api/mod.rs index 3ffa3edd64..fa453d3c83 100644 --- a/common/client-libs/validator-client/src/nym_api/mod.rs +++ b/common/client-libs/validator-client/src/nym_api/mod.rs @@ -3,8 +3,6 @@ use crate::nym_api::error::NymAPIError; use crate::nym_api::routes::{CORE_STATUS_COUNT, SINCE_ARG}; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixId}; use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; @@ -15,6 +13,8 @@ use nym_api_requests::models::{ MixnodeUptimeHistoryResponse, RequestError, RewardEstimationResponse, StakeSaturationResponse, UptimeResponse, }; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixId}; use reqwest::Response; use serde::{Deserialize, Serialize}; use url::Url; diff --git a/common/client-libs/validator-client/src/nyxd/mod.rs b/common/client-libs/validator-client/src/nyxd/mod.rs index fa92389e4c..ac70ac63fb 100644 --- a/common/client-libs/validator-client/src/nyxd/mod.rs +++ b/common/client-libs/validator-client/src/nyxd/mod.rs @@ -17,13 +17,13 @@ use cosmrs::rpc::HttpClientUrl; use cosmrs::tx::Msg; use execute::execute; use log::debug; -use mixnet_contract_common::MixId; use network_defaults::{ChainDetails, NymNetworkDetails}; +use nym_mixnet_contract_common::MixId; +use nym_vesting_contract_common::ExecuteMsg as VestingExecuteMsg; +use nym_vesting_contract_common::PledgeCap; use serde::{Deserialize, Serialize}; use std::convert::TryInto; use std::time::SystemTime; -use vesting_contract_common::ExecuteMsg as VestingExecuteMsg; -use vesting_contract_common::PledgeCap; pub use crate::nyxd::cosmwasm_client::client::CosmWasmClient; pub use crate::nyxd::cosmwasm_client::signing_client::SigningCosmWasmClient; diff --git a/common/client-libs/validator-client/src/nyxd/traits/dkg_signing_client.rs b/common/client-libs/validator-client/src/nyxd/traits/dkg_signing_client.rs index 90df5b5db7..45fdd2cbbc 100644 --- a/common/client-libs/validator-client/src/nyxd/traits/dkg_signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/traits/dkg_signing_client.rs @@ -8,7 +8,7 @@ use async_trait::async_trait; use coconut_dkg_common::msg::ExecuteMsg as DkgExecuteMsg; use coconut_dkg_common::types::EncodedBTEPublicKeyWithProof; use coconut_dkg_common::verification_key::VerificationKeyShare; -use contracts_common::dealings::ContractSafeBytes; +use nym_contracts_common::dealings::ContractSafeBytes; #[async_trait] pub trait DkgSigningClient { diff --git a/common/client-libs/validator-client/src/nyxd/traits/mixnet_query_client.rs b/common/client-libs/validator-client/src/nyxd/traits/mixnet_query_client.rs index 97643bdabb..640969fe2b 100644 --- a/common/client-libs/validator-client/src/nyxd/traits/mixnet_query_client.rs +++ b/common/client-libs/validator-client/src/nyxd/traits/mixnet_query_client.rs @@ -6,17 +6,17 @@ use crate::nyxd::error::NyxdError; use crate::nyxd::NyxdClient; use async_trait::async_trait; use cosmrs::AccountId; -use mixnet_contract_common::delegation::{MixNodeDelegationResponse, OwnerProxySubKey}; -use mixnet_contract_common::families::Family; -use mixnet_contract_common::mixnode::{ +use nym_mixnet_contract_common::delegation::{MixNodeDelegationResponse, OwnerProxySubKey}; +use nym_mixnet_contract_common::families::Family; +use nym_mixnet_contract_common::mixnode::{ MixNodeDetails, MixnodeRewardingDetailsResponse, PagedMixnodesDetailsResponse, PagedUnbondedMixnodesResponse, StakeSaturationResponse, UnbondedMixnodeResponse, }; -use mixnet_contract_common::reward_params::{Performance, RewardingParams}; -use mixnet_contract_common::rewarding::{ +use nym_mixnet_contract_common::reward_params::{Performance, RewardingParams}; +use nym_mixnet_contract_common::rewarding::{ EstimatedCurrentEpochRewardResponse, PendingRewardResponse, }; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::{ delegation, ContractBuildInformation, ContractState, ContractStateParams, CurrentIntervalResponse, EpochEventId, GatewayBondResponse, GatewayOwnershipResponse, IdentityKey, IntervalEventId, LayerDistribution, MixId, MixOwnershipResponse, diff --git a/common/client-libs/validator-client/src/nyxd/traits/mixnet_signing_client.rs b/common/client-libs/validator-client/src/nyxd/traits/mixnet_signing_client.rs index 0288f73828..b780acb9ef 100644 --- a/common/client-libs/validator-client/src/nyxd/traits/mixnet_signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/traits/mixnet_signing_client.rs @@ -8,9 +8,9 @@ use crate::nyxd::error::NyxdError; use crate::nyxd::{Fee, NyxdClient, SigningCosmWasmClient}; use async_trait::async_trait; use cosmrs::AccountId; -use mixnet_contract_common::mixnode::{MixNodeConfigUpdate, MixNodeCostParams}; -use mixnet_contract_common::reward_params::{IntervalRewardingParamsUpdate, Performance}; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::mixnode::{MixNodeConfigUpdate, MixNodeCostParams}; +use nym_mixnet_contract_common::reward_params::{IntervalRewardingParamsUpdate, Performance}; +use nym_mixnet_contract_common::{ ContractStateParams, ExecuteMsg as MixnetExecuteMsg, Gateway, LayerAssignment, MixId, MixNode, }; diff --git a/common/client-libs/validator-client/src/nyxd/traits/vesting_query_client.rs b/common/client-libs/validator-client/src/nyxd/traits/vesting_query_client.rs index 3d753e4bdc..ef54f11ef1 100644 --- a/common/client-libs/validator-client/src/nyxd/traits/vesting_query_client.rs +++ b/common/client-libs/validator-client/src/nyxd/traits/vesting_query_client.rs @@ -6,16 +6,16 @@ pub use crate::nyxd::cosmwasm_client::client::CosmWasmClient; use crate::nyxd::error::NyxdError; use crate::nyxd::NyxdClient; use async_trait::async_trait; -use contracts_common::ContractBuildInformation; use cosmwasm_std::{Coin as CosmWasmCoin, Timestamp}; -use mixnet_contract_common::MixId; -use serde::Deserialize; -use vesting_contract::vesting::Account; -use vesting_contract_common::{ +use nym_contracts_common::ContractBuildInformation; +use nym_mixnet_contract_common::MixId; +use nym_vesting_contract_common::{ messages::QueryMsg as VestingQueryMsg, AccountVestingCoins, AccountsResponse, AllDelegationsResponse, BaseVestingAccountInfo, DelegationTimesResponse, OriginalVestingResponse, Period, PledgeData, VestingCoinsResponse, VestingDelegation, }; +use serde::Deserialize; +use vesting_contract::vesting::Account; #[async_trait] pub trait VestingQueryClient { diff --git a/common/client-libs/validator-client/src/nyxd/traits/vesting_signing_client.rs b/common/client-libs/validator-client/src/nyxd/traits/vesting_signing_client.rs index 0b34ae362b..e2d622d12d 100644 --- a/common/client-libs/validator-client/src/nyxd/traits/vesting_signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/traits/vesting_signing_client.rs @@ -6,10 +6,12 @@ use crate::nyxd::cosmwasm_client::types::ExecuteResult; use crate::nyxd::error::NyxdError; use crate::nyxd::{Coin, Fee, NyxdClient}; use async_trait::async_trait; -use mixnet_contract_common::mixnode::{MixNodeConfigUpdate, MixNodeCostParams}; -use mixnet_contract_common::{Gateway, MixId, MixNode}; -use vesting_contract_common::messages::{ExecuteMsg as VestingExecuteMsg, VestingSpecification}; -use vesting_contract_common::PledgeCap; +use nym_mixnet_contract_common::mixnode::{MixNodeConfigUpdate, MixNodeCostParams}; +use nym_mixnet_contract_common::{Gateway, MixId, MixNode}; +use nym_vesting_contract_common::messages::{ + ExecuteMsg as VestingExecuteMsg, VestingSpecification, +}; +use nym_vesting_contract_common::PledgeCap; #[async_trait] pub trait VestingSigningClient { diff --git a/common/commands/Cargo.toml b/common/commands/Cargo.toml index e8d9180b06..eb785764d9 100644 --- a/common/commands/Cargo.toml +++ b/common/commands/Cargo.toml @@ -30,8 +30,8 @@ cosmwasm-std = { version = "1.0.0" } validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] } network-defaults = { path = "../network-defaults" } -mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path = "../cosmwasm-smart-contracts/vesting-contract" } +nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } +nym-vesting-contract-common = { path = "../cosmwasm-smart-contracts/vesting-contract" } coconut-bandwidth-contract-common = { path = "../cosmwasm-smart-contracts/coconut-bandwidth-contract" } coconut-dkg-common = { path = "../cosmwasm-smart-contracts/coconut-dkg" } multisig-contract-common = { path = "../cosmwasm-smart-contracts/multisig-contract" } diff --git a/common/commands/src/validator/cosmwasm/generators/mixnet.rs b/common/commands/src/validator/cosmwasm/generators/mixnet.rs index 8d47ffbca6..bb08b31462 100644 --- a/common/commands/src/validator/cosmwasm/generators/mixnet.rs +++ b/common/commands/src/validator/cosmwasm/generators/mixnet.rs @@ -5,7 +5,7 @@ use clap::Parser; use log::{debug, info}; use cosmwasm_std::Decimal; -use mixnet_contract_common::{InitialRewardingParams, InstantiateMsg, Percent}; +use nym_mixnet_contract_common::{InitialRewardingParams, InstantiateMsg, Percent}; use std::str::FromStr; use std::time::Duration; use validator_client::nyxd::AccountId; diff --git a/common/commands/src/validator/cosmwasm/generators/vesting.rs b/common/commands/src/validator/cosmwasm/generators/vesting.rs index c73885587a..d10e222d57 100644 --- a/common/commands/src/validator/cosmwasm/generators/vesting.rs +++ b/common/commands/src/validator/cosmwasm/generators/vesting.rs @@ -6,8 +6,8 @@ use std::str::FromStr; use clap::Parser; use log::{debug, info}; +use nym_vesting_contract_common::InitMsg; use validator_client::nyxd::AccountId; -use vesting_contract_common::InitMsg; #[derive(Debug, Parser)] pub struct Args { diff --git a/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs b/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs index 696a2e977d..ebb4db143f 100644 --- a/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::{Coin, MixId}; +use nym_mixnet_contract_common::{Coin, MixId}; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/delegators/query_for_delegations.rs b/common/commands/src/validator/mixnet/delegators/query_for_delegations.rs index 68a347a1fc..4e6d91926b 100644 --- a/common/commands/src/validator/mixnet/delegators/query_for_delegations.rs +++ b/common/commands/src/validator/mixnet/delegators/query_for_delegations.rs @@ -9,7 +9,7 @@ use crate::utils::{pretty_cosmwasm_coin, show_error_passthrough}; use comfy_table::Table; use cosmwasm_std::Addr; -use mixnet_contract_common::{Delegation, PendingEpochEvent, PendingEpochEventKind}; +use nym_mixnet_contract_common::{Delegation, PendingEpochEvent, PendingEpochEventKind}; #[derive(Debug, Parser)] pub struct Args {} diff --git a/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs b/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs index 474d6d4233..efdd9f4f6c 100644 --- a/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs +++ b/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs b/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs index a3a9fbc385..bb30d115c4 100644 --- a/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs +++ b/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs b/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs index 1bdc5f5305..e36fac1c73 100644 --- a/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs b/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs index 273904122d..5d6b5f0547 100644 --- a/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs @@ -4,7 +4,7 @@ use clap::Parser; use log::info; -use mixnet_contract_common::{Coin, MixId}; +use nym_mixnet_contract_common::{Coin, MixId}; use validator_client::nyxd::traits::MixnetQueryClient; use validator_client::nyxd::VestingSigningClient; diff --git a/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs b/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs index 2acafae9bd..a333df365f 100644 --- a/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs @@ -3,7 +3,7 @@ use clap::Parser; use log::info; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use validator_client::nyxd::traits::MixnetQueryClient; use validator_client::nyxd::VestingSigningClient; diff --git a/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs index 34b652a567..376c9dbcb7 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs @@ -4,8 +4,8 @@ use crate::context::SigningClient; use clap::Parser; use log::{info, warn}; -use mixnet_contract_common::Coin; use network_defaults::{DEFAULT_CLIENT_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT}; +use nym_mixnet_contract_common::Coin; use validator_client::nyxd::traits::MixnetSigningClient; #[derive(Debug, Parser)] @@ -55,7 +55,7 @@ pub async fn bond_gateway(args: Args, client: SigningClient) { return; } - let gateway = mixnet_contract_common::Gateway { + let gateway = nym_mixnet_contract_common::Gateway { host: args.host, mix_port: args.mix_port.unwrap_or(DEFAULT_MIX_LISTENING_PORT), clients_port: args.clients_port.unwrap_or(DEFAULT_CLIENT_LISTENING_PORT), diff --git a/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs index c4e3854fd4..a25ca4aa6a 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs @@ -4,8 +4,8 @@ use crate::context::SigningClient; use clap::Parser; use log::{info, warn}; -use mixnet_contract_common::{Coin, Gateway}; use network_defaults::{DEFAULT_CLIENT_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT}; +use nym_mixnet_contract_common::{Coin, Gateway}; use validator_client::nyxd::VestingSigningClient; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs index 0c04845a15..dc394c0e81 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs @@ -5,10 +5,10 @@ use clap::Parser; use cosmwasm_std::Uint128; use log::{info, warn}; -use mixnet_contract_common::{Coin, MixNodeCostParams, Percent}; use network_defaults::{ DEFAULT_HTTP_API_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT, DEFAULT_VERLOC_LISTENING_PORT, }; +use nym_mixnet_contract_common::{Coin, MixNodeCostParams, Percent}; use validator_client::nyxd::traits::MixnetSigningClient; use validator_client::nyxd::CosmWasmCoin; @@ -70,7 +70,7 @@ pub async fn bond_mixnode(args: Args, client: SigningClient) { return; } - let mixnode = mixnet_contract_common::MixNode { + let mixnode = nym_mixnet_contract_common::MixNode { host: args.host, mix_port: args.mix_port.unwrap_or(DEFAULT_MIX_LISTENING_PORT), verloc_port: args.verloc_port.unwrap_or(DEFAULT_VERLOC_LISTENING_PORT), diff --git a/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs b/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs index cb793c61f5..6afc6bfce9 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::MixNodeConfigUpdate; +use nym_mixnet_contract_common::MixNodeConfigUpdate; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs b/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs index 044764c642..02531ff493 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs @@ -4,7 +4,7 @@ use crate::context::SigningClient; use clap::Parser; use log::info; -use mixnet_contract_common::MixNodeConfigUpdate; +use nym_mixnet_contract_common::MixNodeConfigUpdate; use validator_client::nyxd::traits::MixnetQueryClient; use validator_client::nyxd::VestingSigningClient; diff --git a/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs index 3aa8da5969..8e17762168 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs @@ -5,11 +5,11 @@ use crate::context::SigningClient; use clap::Parser; use cosmwasm_std::Uint128; use log::{info, warn}; -use mixnet_contract_common::{Coin, MixNodeCostParams}; -use mixnet_contract_common::{MixNode, Percent}; use network_defaults::{ DEFAULT_HTTP_API_LISTENING_PORT, DEFAULT_MIX_LISTENING_PORT, DEFAULT_VERLOC_LISTENING_PORT, }; +use nym_mixnet_contract_common::{Coin, MixNodeCostParams}; +use nym_mixnet_contract_common::{MixNode, Percent}; use validator_client::nyxd::{CosmWasmCoin, VestingSigningClient}; #[derive(Debug, Parser)] diff --git a/common/commands/src/validator/vesting/create_vesting_schedule.rs b/common/commands/src/validator/vesting/create_vesting_schedule.rs index d022f2ce3a..5766c7d0df 100644 --- a/common/commands/src/validator/vesting/create_vesting_schedule.rs +++ b/common/commands/src/validator/vesting/create_vesting_schedule.rs @@ -6,13 +6,13 @@ use std::str::FromStr; use clap::Parser; use log::info; -use mixnet_contract_common::Coin; use network_defaults::NymNetworkDetails; +use nym_mixnet_contract_common::Coin; +use nym_vesting_contract_common::messages::VestingSpecification; +use nym_vesting_contract_common::PledgeCap; use validator_client::nyxd::AccountId; use validator_client::nyxd::VestingSigningClient; use validator_client::nyxd::{CosmosCoin, Denom}; -use vesting_contract_common::messages::VestingSpecification; -use vesting_contract_common::PledgeCap; use crate::context::SigningClient; diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml index cffca1ac3d..59eb21e5c0 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml +++ b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml @@ -11,5 +11,5 @@ cw-utils = "0.13.4" schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -contracts-common = { path = "../contracts-common" } -multisig-contract-common = { path = "../multisig-contract" } \ No newline at end of file +contracts-common = { path = "../contracts-common", package = "nym-contracts-common" } +multisig-contract-common = { path = "../multisig-contract" } diff --git a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml index dd655d21d9..770980330a 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml +++ b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "contracts-common" +name = "nym-contracts-common" version = "0.1.0" authors = ["Jędrzej Stuczyński "] edition = "2021" @@ -15,4 +15,4 @@ serde = { version = "1.0", features = ["derive"] } thiserror = "1" [dev-dependencies] -serde_json = "1.0.0" \ No newline at end of file +serde_json = "1.0.0" diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml index 1cc5118582..1349a079ab 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mixnet-contract-common" +name = "nym-mixnet-contract-common" version = "0.1.0" authors = ["Jędrzej Stuczyński "] edition = "2021" @@ -14,7 +14,7 @@ serde = { version = "1.0", features = ["derive"] } serde_repr = "0.1" schemars = "0.8" thiserror = "1.0" -contracts-common = { path = "../contracts-common" } +contracts-common = { path = "../contracts-common", package = "nym-contracts-common" } serde_json = "1.0.0" humantime-serde = "1.1.1" diff --git a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml index c4a51aff9d..2bcde9979d 100644 --- a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "vesting-contract-common" +name = "nym-vesting-contract-common" version = "0.1.0" edition = "2021" [dependencies] cosmwasm-std = "1.0.0" -mixnet-contract-common = { path = "../mixnet-contract" } -contracts-common = { path = "../contracts-common" } +mixnet-contract-common = { path = "../mixnet-contract", package = "nym-mixnet-contract-common" } +contracts-common = { path = "../contracts-common", package = "nym-contracts-common" } serde = { version = "1.0", features = ["derive"] } schemars = "0.8" ts-rs = {version = "6.1.2", optional = true} diff --git a/common/credentials/Cargo.toml b/common/credentials/Cargo.toml index e1669910f6..b69c5f12f5 100644 --- a/common/credentials/Cargo.toml +++ b/common/credentials/Cargo.toml @@ -12,7 +12,7 @@ thiserror = "1.0" # I guess temporarily until we get serde support in coconut up and running coconut-interface = { path = "../coconut-interface" } -crypto = { path = "../crypto", features = ["rand", "asymmetric", "symmetric", "hashing"] } +nym-crypto = { path = "../crypto", features = ["rand", "asymmetric", "symmetric", "hashing"] } nym-api-requests = { path = "../../nym-api/nym-api-requests" } validator-client = { path = "../client-libs/validator-client" } diff --git a/common/credentials/src/coconut/bandwidth.rs b/common/credentials/src/coconut/bandwidth.rs index 0c759f0caf..78563211a2 100644 --- a/common/credentials/src/coconut/bandwidth.rs +++ b/common/credentials/src/coconut/bandwidth.rs @@ -10,7 +10,7 @@ use coconut_interface::{ hash_to_scalar, prepare_blind_sign, Attribute, BlindSignRequest, Credential, Parameters, PrivateAttribute, PublicAttribute, Signature, VerificationKey, }; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; use cosmrs::tx::Hash; diff --git a/common/credentials/src/coconut/params.rs b/common/credentials/src/coconut/params.rs index 7e2260bc10..906ef7cae0 100644 --- a/common/credentials/src/coconut/params.rs +++ b/common/credentials/src/coconut/params.rs @@ -1,9 +1,9 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::aes::Aes128; -use crypto::blake3; -use crypto::ctr; +use nym_crypto::aes::Aes128; +use nym_crypto::blake3; +use nym_crypto::ctr; type Aes128Ctr = ctr::Ctr64LE; diff --git a/common/credentials/src/coconut/utils.rs b/common/credentials/src/coconut/utils.rs index 171181767e..4de5b8f8ea 100644 --- a/common/credentials/src/coconut/utils.rs +++ b/common/credentials/src/coconut/utils.rs @@ -5,10 +5,10 @@ use coconut_interface::{ aggregate_signature_shares, aggregate_verification_keys, prove_bandwidth_credential, Attribute, BlindedSignature, Credential, Parameters, Signature, SignatureShare, VerificationKey, }; -use crypto::asymmetric::encryption::PublicKey; -use crypto::shared_key::recompute_shared_key; -use crypto::symmetric::stream_cipher; use nym_api_requests::coconut::BlindSignRequestBody; +use nym_crypto::asymmetric::encryption::PublicKey; +use nym_crypto::shared_key::recompute_shared_key; +use nym_crypto::symmetric::stream_cipher; use validator_client::client::CoconutApiClient; use crate::coconut::bandwidth::{BandwidthVoucher, PRIVATE_ATTRIBUTES, PUBLIC_ATTRIBUTES}; diff --git a/common/credentials/src/error.rs b/common/credentials/src/error.rs index 7826e40615..4c146b0af8 100644 --- a/common/credentials/src/error.rs +++ b/common/credentials/src/error.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use coconut_interface::CoconutError; -use crypto::asymmetric::encryption::KeyRecoveryError; +use nym_crypto::asymmetric::encryption::KeyRecoveryError; use validator_client::ValidatorClientError; use thiserror::Error; diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index 94d3d2820b..3ae7f0c2ac 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "crypto" +name = "nym-crypto" version = "0.1.0" authors = ["Jedrzej Stuczynski // SPDX-License-Identifier: Apache-2.0 -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use std::fmt::{self, Display, Formatter}; use thiserror::Error; diff --git a/common/crypto/src/asymmetric/identity/mod.rs b/common/crypto/src/asymmetric/identity/mod.rs index d8f6e2983c..c72f028607 100644 --- a/common/crypto/src/asymmetric/identity/mod.rs +++ b/common/crypto/src/asymmetric/identity/mod.rs @@ -4,8 +4,8 @@ pub use ed25519_dalek::ed25519::signature::Signature as SignatureTrait; pub use ed25519_dalek::SignatureError; pub use ed25519_dalek::{Verifier, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SIGNATURE_LENGTH}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use nymsphinx_types::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use thiserror::Error; diff --git a/common/mixnode-common/Cargo.toml b/common/mixnode-common/Cargo.toml index 04d225fac9..904d457c8e 100644 --- a/common/mixnode-common/Cargo.toml +++ b/common/mixnode-common/Cargo.toml @@ -18,7 +18,7 @@ tokio-util = { version = "0.7.4", features = ["codec"] } url = "2.2" thiserror = "1.0.37" -crypto = { path = "../crypto" } +nym-crypto = { path = "../crypto" } network-defaults = { path = "../network-defaults" } nymsphinx-acknowledgements = { path = "../nymsphinx/acknowledgements" } nymsphinx-addressing = { path = "../nymsphinx/addressing" } diff --git a/common/mixnode-common/src/verloc/listener.rs b/common/mixnode-common/src/verloc/listener.rs index dc1c133892..4324a0712c 100644 --- a/common/mixnode-common/src/verloc/listener.rs +++ b/common/mixnode-common/src/verloc/listener.rs @@ -4,9 +4,9 @@ use crate::verloc::error::RttError; use crate::verloc::packet::{EchoPacket, ReplyPacket}; use bytes::{BufMut, BytesMut}; -use crypto::asymmetric::identity; use futures::StreamExt; use log::*; +use nym_crypto::asymmetric::identity; use std::fmt::{Display, Formatter}; use std::net::SocketAddr; use std::sync::Arc; diff --git a/common/mixnode-common/src/verloc/measurement.rs b/common/mixnode-common/src/verloc/measurement.rs index 5c23d523a5..6f3d93bb65 100644 --- a/common/mixnode-common/src/verloc/measurement.rs +++ b/common/mixnode-common/src/verloc/measurement.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use serde::{Serialize, Serializer}; use std::cmp::Ordering; use std::fmt::{self, Display, Formatter}; diff --git a/common/mixnode-common/src/verloc/mod.rs b/common/mixnode-common/src/verloc/mod.rs index 69e2df9480..384a0abfda 100644 --- a/common/mixnode-common/src/verloc/mod.rs +++ b/common/mixnode-common/src/verloc/mod.rs @@ -3,11 +3,11 @@ use crate::verloc::listener::PacketListener; use crate::verloc::sender::{PacketSender, TestedNode}; -use crypto::asymmetric::identity; use futures::stream::FuturesUnordered; use futures::StreamExt; use log::*; use network_defaults::mainnet::NYM_API; +use nym_crypto::asymmetric::identity; use rand::seq::SliceRandom; use rand::thread_rng; use std::net::SocketAddr; diff --git a/common/mixnode-common/src/verloc/packet.rs b/common/mixnode-common/src/verloc/packet.rs index ad91aa7fda..80d7f59ac9 100644 --- a/common/mixnode-common/src/verloc/packet.rs +++ b/common/mixnode-common/src/verloc/packet.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::verloc::error::RttError; -use crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH}; +use nym_crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH}; use std::convert::TryInto; pub(crate) struct EchoPacket { diff --git a/common/mixnode-common/src/verloc/sender.rs b/common/mixnode-common/src/verloc/sender.rs index c0f1cefa15..91bb596bab 100644 --- a/common/mixnode-common/src/verloc/sender.rs +++ b/common/mixnode-common/src/verloc/sender.rs @@ -4,8 +4,8 @@ use crate::verloc::error::RttError; use crate::verloc::measurement::Measurement; use crate::verloc::packet::{EchoPacket, ReplyPacket}; -use crypto::asymmetric::identity; use log::*; +use nym_crypto::asymmetric::identity; use rand::{thread_rng, Rng}; use std::net::SocketAddr; use std::sync::Arc; diff --git a/common/nymcoconut/Cargo.toml b/common/nymcoconut/Cargo.toml index 0aaf2d3770..584bad2ca1 100644 --- a/common/nymcoconut/Cargo.toml +++ b/common/nymcoconut/Cargo.toml @@ -18,7 +18,7 @@ bs58 = "0.4.0" sha2 = "0.9" dkg = { path = "../crypto/dkg" } -pemstore = { path = "../pemstore" } +nym-pemstore = { path = "../pemstore" } [dependencies.ff] version = "0.11" diff --git a/common/nymcoconut/src/scheme/keygen.rs b/common/nymcoconut/src/scheme/keygen.rs index ee694b6c48..352d704193 100644 --- a/common/nymcoconut/src/scheme/keygen.rs +++ b/common/nymcoconut/src/scheme/keygen.rs @@ -9,7 +9,7 @@ use std::convert::TryInto; use bls12_381::{G1Projective, G2Projective, Scalar}; use group::Curve; -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use serde_derive::{Deserialize, Serialize}; use crate::error::{CoconutError, Result}; diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index 0513575ccc..c2e555d19d 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -22,11 +22,11 @@ nymsphinx-types = { path = "types" } # those dependencies are due to intriducing preparer and receiver. Perpaphs that indicates they should be moved # to separate crate? -crypto = { path = "../crypto" } +nym-crypto = { path = "../crypto" } topology = { path = "../topology" } [dev-dependencies] -mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } +nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } # do not include this when compiling into wasm as it somehow when combined together with reqwest, it will require # net2 via tokio-util -> tokio -> mio -> net2 diff --git a/common/nymsphinx/acknowledgements/Cargo.toml b/common/nymsphinx/acknowledgements/Cargo.toml index c05976ade7..d9e1b29e7f 100644 --- a/common/nymsphinx/acknowledgements/Cargo.toml +++ b/common/nymsphinx/acknowledgements/Cargo.toml @@ -10,11 +10,11 @@ edition = "2021" rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" -crypto = { path = "../../crypto", features = ["symmetric", "rand"] } +nym-crypto = { path = "../../crypto", features = ["symmetric", "rand"] } nymsphinx-addressing = { path = "../addressing" } nymsphinx-params = { path = "../params" } nymsphinx-types = { path = "../types" } -pemstore = { path = "../../pemstore" } +nym-pemstore = { path = "../../pemstore" } topology = { path = "../../topology" } diff --git a/common/nymsphinx/acknowledgements/src/identifier.rs b/common/nymsphinx/acknowledgements/src/identifier.rs index 7b7a2ae844..7a8282b109 100644 --- a/common/nymsphinx/acknowledgements/src/identifier.rs +++ b/common/nymsphinx/acknowledgements/src/identifier.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::AckKey; -use crypto::symmetric::stream_cipher::{self, encrypt, iv_from_slice, random_iv, IvSizeUser}; +use nym_crypto::symmetric::stream_cipher::{self, encrypt, iv_from_slice, random_iv, IvSizeUser}; use nymsphinx_params::{ packet_sizes::PacketSize, AckEncryptionAlgorithm, SerializedFragmentIdentifier, FRAG_ID_LEN, }; diff --git a/common/nymsphinx/acknowledgements/src/key.rs b/common/nymsphinx/acknowledgements/src/key.rs index ec65537c87..bfe8b36a2b 100644 --- a/common/nymsphinx/acknowledgements/src/key.rs +++ b/common/nymsphinx/acknowledgements/src/key.rs @@ -1,9 +1,9 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}; +use nym_crypto::symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}; +use nym_pemstore::traits::PemStorableKey; use nymsphinx_params::AckEncryptionAlgorithm; -use pemstore::traits::PemStorableKey; use rand::{CryptoRng, RngCore}; use std::fmt::{self, Display, Formatter}; diff --git a/common/nymsphinx/addressing/Cargo.toml b/common/nymsphinx/addressing/Cargo.toml index 7a85486e4f..d62f86345c 100644 --- a/common/nymsphinx/addressing/Cargo.toml +++ b/common/nymsphinx/addressing/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -crypto = { path = "../../crypto", features = ["asymmetric"] } # all addresses are expressed in terms on their crypto keys +nym-crypto = { path = "../../crypto", features = ["asymmetric"] } # all addresses are expressed in terms on their crypto keys nymsphinx-types = { path = "../types" } # we need to be able to refer to some types defined inside sphinx crate serde = "1.0" # implementing serialization/deserialization for some types, like `Recipient` thiserror = "1.0.37" diff --git a/common/nymsphinx/addressing/src/clients.rs b/common/nymsphinx/addressing/src/clients.rs index 29f7051c6c..929906dac9 100644 --- a/common/nymsphinx/addressing/src/clients.rs +++ b/common/nymsphinx/addressing/src/clients.rs @@ -5,7 +5,7 @@ // it's already destructed). use crate::nodes::{NodeIdentity, NODE_IDENTITY_SIZE}; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; use nymsphinx_types::Destination; use serde::de::{Error as SerdeError, Unexpected, Visitor}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/common/nymsphinx/addressing/src/nodes.rs b/common/nymsphinx/addressing/src/nodes.rs index cf43625c5a..7514341113 100644 --- a/common/nymsphinx/addressing/src/nodes.rs +++ b/common/nymsphinx/addressing/src/nodes.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nymsphinx_types::{NodeAddressBytes, NODE_ADDRESS_LENGTH}; use std::convert::{TryFrom, TryInto}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; diff --git a/common/nymsphinx/anonymous-replies/Cargo.toml b/common/nymsphinx/anonymous-replies/Cargo.toml index 6128eaecfc..d1fc4fd3f8 100644 --- a/common/nymsphinx/anonymous-replies/Cargo.toml +++ b/common/nymsphinx/anonymous-replies/Cargo.toml @@ -12,11 +12,11 @@ bs58 = "0.4" serde = "1.0" thiserror = "1" -crypto = { path = "../../crypto", features = ["symmetric", "rand"] } +nym-crypto = { path = "../../crypto", features = ["symmetric", "rand"] } nymsphinx-addressing = { path = "../addressing" } nymsphinx-params = { path = "../params" } nymsphinx-types = { path = "../types" } topology = { path = "../../topology" } [target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen] -version = "0.2.83" \ No newline at end of file +version = "0.2.83" diff --git a/common/nymsphinx/anonymous-replies/src/encryption_key.rs b/common/nymsphinx/anonymous-replies/src/encryption_key.rs index 7a6689f4a7..63533260a2 100644 --- a/common/nymsphinx/anonymous-replies/src/encryption_key.rs +++ b/common/nymsphinx/anonymous-replies/src/encryption_key.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::{ +use nym_crypto::{ crypto_hash, generic_array::{typenum::Unsigned, GenericArray}, symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}, diff --git a/common/nymsphinx/anonymous-replies/src/reply_surb.rs b/common/nymsphinx/anonymous-replies/src/reply_surb.rs index 1fb29b2910..0e50d847f9 100644 --- a/common/nymsphinx/anonymous-replies/src/reply_surb.rs +++ b/common/nymsphinx/anonymous-replies/src/reply_surb.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::encryption_key::{SurbEncryptionKey, SurbEncryptionKeyError, SurbEncryptionKeySize}; -use crypto::{generic_array::typenum::Unsigned, Digest}; +use nym_crypto::{generic_array::typenum::Unsigned, Digest}; use nymsphinx_addressing::clients::Recipient; use nymsphinx_addressing::nodes::{NymNodeRoutingAddress, MAX_NODE_ADDRESS_UNPADDED_LEN}; use nymsphinx_params::packet_sizes::PacketSize; diff --git a/common/nymsphinx/cover/Cargo.toml b/common/nymsphinx/cover/Cargo.toml index 064ebf1298..88daa7e879 100644 --- a/common/nymsphinx/cover/Cargo.toml +++ b/common/nymsphinx/cover/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" -crypto = { path = "../../crypto" } +nym-crypto = { path = "../../crypto" } nymsphinx-acknowledgements = { path = "../acknowledgements" } nymsphinx-addressing = { path = "../addressing" } nymsphinx-chunking = { path = "../chunking" } diff --git a/common/nymsphinx/cover/src/lib.rs b/common/nymsphinx/cover/src/lib.rs index 2ce9454d5c..746521ee71 100644 --- a/common/nymsphinx/cover/src/lib.rs +++ b/common/nymsphinx/cover/src/lib.rs @@ -1,8 +1,8 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::shared_key::new_ephemeral_shared_key; -use crypto::symmetric::stream_cipher; +use nym_crypto::shared_key::new_ephemeral_shared_key; +use nym_crypto::symmetric::stream_cipher; use nymsphinx_acknowledgements::surb_ack::SurbAck; use nymsphinx_acknowledgements::AckKey; use nymsphinx_addressing::clients::Recipient; diff --git a/common/nymsphinx/params/Cargo.toml b/common/nymsphinx/params/Cargo.toml index ebca914742..4956991730 100644 --- a/common/nymsphinx/params/Cargo.toml +++ b/common/nymsphinx/params/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" [dependencies] thiserror = "1.0.37" -crypto = { path = "../../crypto", features = ["hashing", "symmetric"] } +nym-crypto = { path = "../../crypto", features = ["hashing", "symmetric"] } nymsphinx-types = { path = "../types" } diff --git a/common/nymsphinx/params/src/lib.rs b/common/nymsphinx/params/src/lib.rs index d954163861..5df4db1a2a 100644 --- a/common/nymsphinx/params/src/lib.rs +++ b/common/nymsphinx/params/src/lib.rs @@ -1,9 +1,9 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::aes::Aes128; -use crypto::blake3; -use crypto::ctr; +use nym_crypto::aes::Aes128; +use nym_crypto::blake3; +use nym_crypto::ctr; type Aes128Ctr = ctr::Ctr64BE; diff --git a/common/nymsphinx/src/message.rs b/common/nymsphinx/src/message.rs index f9b32daa35..86cfecea59 100644 --- a/common/nymsphinx/src/message.rs +++ b/common/nymsphinx/src/message.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::chunking; -use crypto::asymmetric::encryption; -use crypto::Digest; +use nym_crypto::asymmetric::encryption; +use nym_crypto::Digest; use nymsphinx_addressing::clients::Recipient; use nymsphinx_addressing::nodes::MAX_NODE_ADDRESS_UNPADDED_LEN; use nymsphinx_anonymous_replies::requests::{ diff --git a/common/nymsphinx/src/preparer/payload.rs b/common/nymsphinx/src/preparer/payload.rs index 94acde03c8..41eb2b4c4c 100644 --- a/common/nymsphinx/src/preparer/payload.rs +++ b/common/nymsphinx/src/preparer/payload.rs @@ -1,11 +1,11 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::aes::cipher::{KeyIvInit, StreamCipher}; -use crypto::asymmetric::encryption; -use crypto::shared_key::new_ephemeral_shared_key; -use crypto::symmetric::stream_cipher; -use crypto::symmetric::stream_cipher::CipherKey; +use nym_crypto::aes::cipher::{KeyIvInit, StreamCipher}; +use nym_crypto::asymmetric::encryption; +use nym_crypto::shared_key::new_ephemeral_shared_key; +use nym_crypto::symmetric::stream_cipher; +use nym_crypto::symmetric::stream_cipher::CipherKey; use nymsphinx_acknowledgements::surb_ack::SurbAck; use nymsphinx_anonymous_replies::SurbEncryptionKey; use nymsphinx_chunking::fragment::Fragment; diff --git a/common/nymsphinx/src/receiver.rs b/common/nymsphinx/src/receiver.rs index 453f632f76..6656a23c31 100644 --- a/common/nymsphinx/src/receiver.rs +++ b/common/nymsphinx/src/receiver.rs @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use crate::message::{NymMessage, NymMessageError, PaddedMessage, PlainMessage}; -use crypto::aes::cipher::{KeyIvInit, StreamCipher}; -use crypto::asymmetric::encryption; -use crypto::shared_key::recompute_shared_key; -use crypto::symmetric::stream_cipher; -use crypto::symmetric::stream_cipher::CipherKey; +use nym_crypto::aes::cipher::{KeyIvInit, StreamCipher}; +use nym_crypto::asymmetric::encryption; +use nym_crypto::shared_key::recompute_shared_key; +use nym_crypto::symmetric::stream_cipher; +use nym_crypto::symmetric::stream_cipher::CipherKey; use nymsphinx_anonymous_replies::requests::AnonymousSenderTag; use nymsphinx_anonymous_replies::SurbEncryptionKey; use nymsphinx_chunking::fragment::Fragment; @@ -184,8 +184,8 @@ impl Default for MessageReceiver { #[cfg(test)] mod message_receiver { use super::*; - use crypto::asymmetric::identity; - use mixnet_contract_common::Layer; + use nym_crypto::asymmetric::identity; + use nym_mixnet_contract_common::Layer; use std::collections::HashMap; use topology::{gateway, mix, NymTopology}; diff --git a/common/pemstore/Cargo.toml b/common/pemstore/Cargo.toml index db4b331327..854b530b69 100644 --- a/common/pemstore/Cargo.toml +++ b/common/pemstore/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pemstore" +name = "nym-pemstore" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" diff --git a/common/topology/Cargo.toml b/common/topology/Cargo.toml index 42480168cc..c0147bb03f 100644 --- a/common/topology/Cargo.toml +++ b/common/topology/Cargo.toml @@ -13,8 +13,8 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] } thiserror = "1.0.37" ## internal -crypto = { path = "../crypto" } -mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } +nym-crypto = { path = "../crypto" } +nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" } nymsphinx-addressing = { path = "../nymsphinx/addressing" } nymsphinx-types = { path = "../nymsphinx/types" } version-checker = { path = "../version-checker" } diff --git a/common/topology/src/gateway.rs b/common/topology/src/gateway.rs index 9df2156b32..40b217b714 100644 --- a/common/topology/src/gateway.rs +++ b/common/topology/src/gateway.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{filter, NetworkAddress}; -use crypto::asymmetric::{encryption, identity}; -use mixnet_contract_common::GatewayBond; +use nym_crypto::asymmetric::{encryption, identity}; +use nym_mixnet_contract_common::GatewayBond; use nymsphinx_addressing::nodes::{NodeIdentity, NymNodeRoutingAddress}; use nymsphinx_types::Node as SphinxNode; use std::convert::{TryFrom, TryInto}; diff --git a/common/topology/src/lib.rs b/common/topology/src/lib.rs index 527176339d..7bd511e72b 100644 --- a/common/topology/src/lib.rs +++ b/common/topology/src/lib.rs @@ -3,8 +3,8 @@ use crate::filter::VersionFilterable; use log::warn; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::GatewayBond; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::GatewayBond; use nymsphinx_addressing::nodes::NodeIdentity; use nymsphinx_types::Node as SphinxNode; use rand::Rng; @@ -303,10 +303,10 @@ mod converting_mixes_to_vec { #[cfg(test)] mod when_nodes_exist { - use crypto::asymmetric::{encryption, identity}; + use nym_crypto::asymmetric::{encryption, identity}; use super::*; - use mixnet_contract_common::Layer; + use nym_mixnet_contract_common::Layer; #[test] fn returns_a_vec_with_hashmap_values() { diff --git a/common/topology/src/mix.rs b/common/topology/src/mix.rs index 08d7f5c0b7..f8756f4e55 100644 --- a/common/topology/src/mix.rs +++ b/common/topology/src/mix.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{filter, NetworkAddress}; -use crypto::asymmetric::{encryption, identity}; -use mixnet_contract_common::{Layer, MixId, MixNodeBond}; +use nym_crypto::asymmetric::{encryption, identity}; +use nym_mixnet_contract_common::{Layer, MixId, MixNodeBond}; use nymsphinx_addressing::nodes::NymNodeRoutingAddress; use nymsphinx_types::Node as SphinxNode; use std::convert::{TryFrom, TryInto}; diff --git a/common/types/Cargo.toml b/common/types/Cargo.toml index 04030da607..7b8ddaac39 100644 --- a/common/types/Cargo.toml +++ b/common/types/Cargo.toml @@ -25,16 +25,16 @@ cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegr validator-client = { path = "../../common/client-libs/validator-client", features = [ "nyxd-client", ] } -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } +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" } coconut-interface = { path = "../../common/coconut-interface" } # Used for Type conversion, can be extracted but its a lot of work -vesting-contract = { path = "../../contracts/vesting" } +nym-vesting-contract = { path = "../../contracts/vesting" } [dev-dependencies] tempfile = "3.3.0" [features] default = [] -generate-ts = ["mixnet-contract-common/generate-ts"] +generate-ts = ["nym-mixnet-contract-common/generate-ts"] diff --git a/common/types/src/delegation.rs b/common/types/src/delegation.rs index bee74dd646..399bf7b91b 100644 --- a/common/types/src/delegation.rs +++ b/common/types/src/delegation.rs @@ -3,7 +3,7 @@ use crate::deprecated::DelegationEvent; use crate::error::TypesError; use crate::mixnode::MixNodeCostParams; use cosmwasm_std::Decimal; -use mixnet_contract_common::{Delegation as MixnetContractDelegation, MixId}; +use nym_mixnet_contract_common::{Delegation as MixnetContractDelegation, MixId}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/common/types/src/deprecated.rs b/common/types/src/deprecated.rs index 62c7193c9e..87f1f04e50 100644 --- a/common/types/src/deprecated.rs +++ b/common/types/src/deprecated.rs @@ -4,7 +4,7 @@ use crate::currency::DecCoin; use crate::error::TypesError; use crate::pending_events::{PendingEpochEvent, PendingEpochEventData}; -use mixnet_contract_common::{IdentityKey, MixId}; +use nym_mixnet_contract_common::{IdentityKey, MixId}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/common/types/src/gateway.rs b/common/types/src/gateway.rs index 221097354c..d512ef5f30 100644 --- a/common/types/src/gateway.rs +++ b/common/types/src/gateway.rs @@ -1,6 +1,6 @@ use crate::currency::{DecCoin, RegisteredCoins}; use crate::error::TypesError; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::{ Gateway as MixnetContractGateway, GatewayBond as MixnetContractGatewayBond, }; use schemars::JsonSchema; diff --git a/common/types/src/mixnode.rs b/common/types/src/mixnode.rs index 6e27c6f8d7..4518700449 100644 --- a/common/types/src/mixnode.rs +++ b/common/types/src/mixnode.rs @@ -4,7 +4,7 @@ use crate::currency::{DecCoin, RegisteredCoins}; use crate::error::TypesError; use cosmwasm_std::Decimal; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::{ EpochId, MixId, MixNode, MixNodeBond as MixnetContractMixNodeBond, MixNodeCostParams as MixnetContractMixNodeCostParams, MixNodeDetails as MixnetContractMixNodeDetails, diff --git a/common/types/src/pending_events.rs b/common/types/src/pending_events.rs index e9d578dc12..8f537fc200 100644 --- a/common/types/src/pending_events.rs +++ b/common/types/src/pending_events.rs @@ -4,7 +4,7 @@ use crate::currency::{DecCoin, RegisteredCoins}; use crate::error::TypesError; use crate::mixnode::MixNodeCostParams; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::{ BlockHeight, EpochEventId, IntervalEventId, IntervalRewardingParamsUpdate, MixId, PendingEpochEvent as MixnetContractPendingEpochEvent, PendingEpochEventKind as MixnetContractPendingEpochEventKind, diff --git a/common/types/src/vesting.rs b/common/types/src/vesting.rs index 0c6b6a4c20..9be8ef03da 100644 --- a/common/types/src/vesting.rs +++ b/common/types/src/vesting.rs @@ -1,10 +1,10 @@ use crate::currency::{DecCoin, RegisteredCoins}; use crate::error::TypesError; +use nym_vesting_contract_common::OriginalVestingResponse as ContractOriginalVestingResponse; +use nym_vesting_contract_common::PledgeData as ContractPledgeData; use serde::{Deserialize, Serialize}; use vesting_contract::vesting::Account as ContractVestingAccount; use vesting_contract::vesting::VestingPeriod as ContractVestingPeriod; -use vesting_contract_common::OriginalVestingResponse as ContractOriginalVestingResponse; -use vesting_contract_common::PledgeData as ContractPledgeData; #[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))] #[cfg_attr( diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index de21d0fc92..167c929eb1 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,5 +1,13 @@ [workspace] -members = ["coconut-bandwidth", "mixnet", "vesting", "multisig/cw3-flex-multisig", "multisig/cw4-group", "coconut-test", "coconut-dkg"] +members = [ + "coconut-bandwidth", + "mixnet", + "vesting", + "multisig/cw3-flex-multisig", + "multisig/cw4-group", + "coconut-test", + "coconut-dkg" +] [profile.release] opt-level = 3 @@ -10,4 +18,4 @@ debug-assertions = false codegen-units = 1 panic = 'abort' incremental = false -overflow-checks = true \ No newline at end of file +overflow-checks = true diff --git a/contracts/coconut-dkg/Cargo.toml b/contracts/coconut-dkg/Cargo.toml index 7d3abea20b..4e8d1dcafc 100644 --- a/contracts/coconut-dkg/Cargo.toml +++ b/contracts/coconut-dkg/Cargo.toml @@ -26,4 +26,4 @@ cw-multi-test = { version = "0.13.4" } cw4-group = { path = "../multisig/cw4-group" } group-contract-common = { path = "../../common/cosmwasm-smart-contracts/group-contract" } lazy_static = "1.4" -rusty-fork = "0.3" \ No newline at end of file +rusty-fork = "0.3" diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index 6dc7273c18..931ba18e9b 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mixnet-contract" +name = "nym-mixnet-contract" version = "1.1.2" authors = ["Dave Hrycyszyn "] edition = "2021" @@ -13,11 +13,12 @@ exclude = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] +name = "mixnet_contract" crate-type = ["cdylib", "rlib"] [dependencies] -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } +mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common" } +vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common" } #config = { path = "../../common/config"} cosmwasm-std = "1.0.0" @@ -34,7 +35,7 @@ time = { version = "0.3", features = ["macros"] } cosmwasm-schema = "1.0.0" rand_chacha = "0.2" #rand = "0.7" -crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } +nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } [build-dependencies] vergen = { version = "5", default-features = false, features = ["build", "git", "rustc"] } diff --git a/contracts/mixnet/src/mixnodes/transactions.rs b/contracts/mixnet/src/mixnodes/transactions.rs index 1d0da0449f..9efcc3ab13 100644 --- a/contracts/mixnet/src/mixnodes/transactions.rs +++ b/contracts/mixnet/src/mixnodes/transactions.rs @@ -718,8 +718,8 @@ pub mod tests { let mut deps = test_helpers::init_contract(); let mut rng = test_helpers::test_rng(); - let keypair1 = crypto::asymmetric::identity::KeyPair::new(&mut rng); - let keypair2 = crypto::asymmetric::identity::KeyPair::new(&mut rng); + let keypair1 = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); + let keypair2 = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); let sig1 = keypair1.private_key().sign_text("alice"); let sig2 = keypair1.private_key().sign_text("bob"); @@ -731,7 +731,7 @@ pub mod tests { mix_port: 1234, verloc_port: 1234, http_api_port: 1234, - sphinx_key: crypto::asymmetric::encryption::KeyPair::new(&mut rng) + sphinx_key: nym_crypto::asymmetric::encryption::KeyPair::new(&mut rng) .public_key() .to_base58_string(), identity_key: keypair1.public_key().to_base58_string(), diff --git a/contracts/mixnet/src/support/helpers.rs b/contracts/mixnet/src/support/helpers.rs index ee47b48f3a..8d602f48f6 100644 --- a/contracts/mixnet/src/support/helpers.rs +++ b/contracts/mixnet/src/support/helpers.rs @@ -255,7 +255,7 @@ pub(crate) fn validate_signature( mod tests { use super::*; use cosmwasm_std::testing::mock_dependencies; - use crypto::asymmetric::identity; + use nym_crypto::asymmetric::identity; use rand_chacha::rand_core::SeedableRng; #[test] diff --git a/contracts/mixnet/src/support/tests/messages.rs b/contracts/mixnet/src/support/tests/messages.rs index f3593b3aca..bf9ed53895 100644 --- a/contracts/mixnet/src/support/tests/messages.rs +++ b/contracts/mixnet/src/support/tests/messages.rs @@ -7,7 +7,7 @@ pub(crate) fn valid_bond_gateway_msg( mut rng: impl RngCore + CryptoRng, sender: &str, ) -> (ExecuteMsg, IdentityKey) { - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); let owner_signature = keypair .private_key() .sign(sender.as_bytes()) diff --git a/contracts/mixnet/src/support/tests/mod.rs b/contracts/mixnet/src/support/tests/mod.rs index 9f03f9c93c..5429dc841b 100644 --- a/contracts/mixnet/src/support/tests/mod.rs +++ b/contracts/mixnet/src/support/tests/mod.rs @@ -46,7 +46,6 @@ pub mod test_helpers { use cosmwasm_std::{Deps, OwnedDeps}; use cosmwasm_std::{DepsMut, MessageInfo}; use cosmwasm_std::{Env, Response, Timestamp, Uint128}; - use crypto::asymmetric::identity::KeyPair; use mixnet_contract_common::events::{ may_find_attribute, MixnetEventType, DELEGATES_REWARD_KEY, OPERATOR_REWARD_KEY, }; @@ -60,6 +59,7 @@ pub mod test_helpers { Delegation, Gateway, InitialRewardingParams, InstantiateMsg, Interval, MixId, MixNode, Percent, RewardedSetNodeStatus, }; + use nym_crypto::asymmetric::identity::KeyPair; use rand_chacha::rand_core::{CryptoRng, RngCore, SeedableRng}; use rand_chacha::ChaCha20Rng; use std::time::Duration; @@ -184,13 +184,13 @@ pub mod test_helpers { None => minimum_mixnode_pledge(self.deps.as_ref().storage).unwrap(), }; - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut self.rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut self.rng); let owner_signature = keypair .private_key() .sign(owner.as_bytes()) .to_base58_string(); - let legit_sphinx_key = crypto::asymmetric::encryption::KeyPair::new(&mut self.rng); + let legit_sphinx_key = nym_crypto::asymmetric::encryption::KeyPair::new(&mut self.rng); let info = mock_info(proxy.as_str(), &[stake]); let key = keypair.public_key().to_base58_string(); @@ -558,8 +558,8 @@ pub mod test_helpers { mut rng: impl RngCore + CryptoRng, sender: &str, ) -> (MixNode, String, KeyPair) { - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut rng); - let legit_sphinx_key = crypto::asymmetric::encryption::KeyPair::new(&mut rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); + let legit_sphinx_key = nym_crypto::asymmetric::encryption::KeyPair::new(&mut rng); let owner_signature = keypair .private_key() .sign(sender.as_bytes()) @@ -583,8 +583,8 @@ pub mod test_helpers { mut rng: impl RngCore + CryptoRng, sender: &str, ) -> (Gateway, String) { - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut rng); - let legit_sphinx_key = crypto::asymmetric::encryption::KeyPair::new(&mut rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); + let legit_sphinx_key = nym_crypto::asymmetric::encryption::KeyPair::new(&mut rng); let owner_signature = keypair .private_key() .sign(sender.as_bytes()) @@ -734,13 +734,13 @@ pub mod test_helpers { sender: &str, stake: Vec, ) -> MixId { - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); let owner_signature = keypair .private_key() .sign(sender.as_bytes()) .to_base58_string(); - let legit_sphinx_key = crypto::asymmetric::encryption::KeyPair::new(&mut rng); + let legit_sphinx_key = nym_crypto::asymmetric::encryption::KeyPair::new(&mut rng); let info = mock_info(sender, &stake); let key = keypair.public_key().to_base58_string(); @@ -775,7 +775,7 @@ pub mod test_helpers { sender: &str, stake: Vec, ) -> String { - let keypair = crypto::asymmetric::identity::KeyPair::new(&mut rng); + let keypair = nym_crypto::asymmetric::identity::KeyPair::new(&mut rng); let owner_signature = keypair .private_key() .sign(sender.as_bytes()) diff --git a/contracts/vesting/Cargo.toml b/contracts/vesting/Cargo.toml index 4eb800599a..d9d9120a45 100644 --- a/contracts/vesting/Cargo.toml +++ b/contracts/vesting/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vesting-contract" +name = "nym-vesting-contract" version = "1.1.3" authors = ["Drazen Urch "] edition = "2021" @@ -11,12 +11,13 @@ exclude = [ ] [lib] +name = "vesting_contract" crate-type = ["cdylib", "rlib"] [dependencies] -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } -contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } +mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common" } +contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common", package = "nym-contracts-common" } +vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common" } cosmwasm-std = { version = "1.0.0 "} cw-storage-plus = { version = "0.13.4", features = ["iterator"] } diff --git a/explorer-api/Cargo.toml b/explorer-api/Cargo.toml index dcfc34eb35..5ec59612f0 100644 --- a/explorer-api/Cargo.toml +++ b/explorer-api/Cargo.toml @@ -29,8 +29,8 @@ rand = "0.8.5" rand_seeder = "0.2.3" rand_pcg = "0.3.1" -mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } -contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common" } +nym-mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } +nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common" } network-defaults = { path = "../common/network-defaults" } logging = { path = "../common/logging"} task = { path = "../common/task" } diff --git a/explorer-api/src/gateways/http.rs b/explorer-api/src/gateways/http.rs index 084507eed5..1f494d0edd 100644 --- a/explorer-api/src/gateways/http.rs +++ b/explorer-api/src/gateways/http.rs @@ -9,7 +9,7 @@ use rocket_okapi::openapi_get_routes_spec; use rocket_okapi::settings::OpenApiSettings; use crate::state::ExplorerApiStateContext; -use mixnet_contract_common::GatewayBond; +use nym_mixnet_contract_common::GatewayBond; pub fn gateways_make_default_routes(settings: &OpenApiSettings) -> (Vec, OpenApi) { openapi_get_routes_spec![settings: list] diff --git a/explorer-api/src/gateways/models.rs b/explorer-api/src/gateways/models.rs index a051d88e6b..ab2712c3fc 100644 --- a/explorer-api/src/gateways/models.rs +++ b/explorer-api/src/gateways/models.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::cache::Cache; -use mixnet_contract_common::{GatewayBond, IdentityKey}; +use nym_mixnet_contract_common::{GatewayBond, IdentityKey}; use serde::Serialize; use std::sync::Arc; use tokio::sync::RwLock; diff --git a/explorer-api/src/helpers.rs b/explorer-api/src/helpers.rs index 6b3d019833..cd271e838c 100644 --- a/explorer-api/src/helpers.rs +++ b/explorer-api/src/helpers.rs @@ -1,7 +1,7 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::{Decimal, Fraction}; +use nym_mixnet_contract_common::{Decimal, Fraction}; pub(crate) fn best_effort_small_dec_to_f64(dec: Decimal) -> f64 { let num = dec.numerator().u128() as f64; diff --git a/explorer-api/src/mix_node/delegations.rs b/explorer-api/src/mix_node/delegations.rs index 00c55446e8..d9c151214d 100644 --- a/explorer-api/src/mix_node/delegations.rs +++ b/explorer-api/src/mix_node/delegations.rs @@ -4,7 +4,7 @@ use super::models::SummedDelegations; use crate::client::ThreadsafeValidatorClient; use itertools::Itertools; -use mixnet_contract_common::{Delegation, MixId}; +use nym_mixnet_contract_common::{Delegation, MixId}; pub(crate) async fn get_single_mixnode_delegations( client: &ThreadsafeValidatorClient, diff --git a/explorer-api/src/mix_node/econ_stats.rs b/explorer-api/src/mix_node/econ_stats.rs index 30d89a29b2..66a4676376 100644 --- a/explorer-api/src/mix_node/econ_stats.rs +++ b/explorer-api/src/mix_node/econ_stats.rs @@ -4,8 +4,8 @@ use crate::client::ThreadsafeValidatorClient; use crate::helpers::best_effort_small_dec_to_f64; use crate::mix_node::models::EconomicDynamicsStats; -use contracts_common::truncate_decimal; -use mixnet_contract_common::MixId; +use nym_contracts_common::truncate_decimal; +use nym_mixnet_contract_common::MixId; pub(crate) async fn retrieve_mixnode_econ_stats( client: &ThreadsafeValidatorClient, diff --git a/explorer-api/src/mix_node/http.rs b/explorer-api/src/mix_node/http.rs index 035e51bc95..137c6250ed 100644 --- a/explorer-api/src/mix_node/http.rs +++ b/explorer-api/src/mix_node/http.rs @@ -9,7 +9,7 @@ use crate::mix_node::models::{ EconomicDynamicsStats, NodeDescription, NodeStats, PrettyDetailedMixNodeBond, SummedDelegations, }; use crate::state::ExplorerApiStateContext; -use mixnet_contract_common::{Delegation, MixId}; +use nym_mixnet_contract_common::{Delegation, MixId}; use reqwest::Error as ReqwestError; use rocket::response::status::NotFound; use rocket::serde::json::Json; diff --git a/explorer-api/src/mix_node/models.rs b/explorer-api/src/mix_node/models.rs index 92f4dbe8aa..ff94f921b4 100644 --- a/explorer-api/src/mix_node/models.rs +++ b/explorer-api/src/mix_node/models.rs @@ -3,9 +3,9 @@ use crate::cache::Cache; use crate::mix_nodes::location::Location; -use contracts_common::Percent; -use mixnet_contract_common::Delegation; -use mixnet_contract_common::{Addr, Coin, Layer, MixId, MixNode}; +use nym_contracts_common::Percent; +use nym_mixnet_contract_common::Delegation; +use nym_mixnet_contract_common::{Addr, Coin, Layer, MixId, MixNode}; use serde::Deserialize; use serde::Serialize; use std::sync::Arc; diff --git a/explorer-api/src/mix_nodes/location.rs b/explorer-api/src/mix_nodes/location.rs index 51c46261c6..b876cdc792 100644 --- a/explorer-api/src/mix_nodes/location.rs +++ b/explorer-api/src/mix_nodes/location.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::geo_ip::location; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::time::{Duration, SystemTime}; diff --git a/explorer-api/src/mix_nodes/models.rs b/explorer-api/src/mix_nodes/models.rs index fdbd99e467..c4483cf192 100644 --- a/explorer-api/src/mix_nodes/models.rs +++ b/explorer-api/src/mix_nodes/models.rs @@ -5,8 +5,8 @@ use std::collections::{HashMap, HashSet}; use std::sync::Arc; use std::time::{Duration, SystemTime}; -use mixnet_contract_common::rewarding::helpers::truncate_reward; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::rewarding::helpers::truncate_reward; +use nym_mixnet_contract_common::MixId; use serde::Serialize; use tokio::sync::{RwLock, RwLockReadGuard}; diff --git a/explorer-api/src/mix_nodes/utils.rs b/explorer-api/src/mix_nodes/utils.rs index e1040dda62..0f7eb6b991 100644 --- a/explorer-api/src/mix_nodes/utils.rs +++ b/explorer-api/src/mix_nodes/utils.rs @@ -1,7 +1,7 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::families::FamilyHead; +use nym_mixnet_contract_common::families::FamilyHead; use rand::Rng; use rand_pcg::Pcg64; use rand_seeder::Seeder; diff --git a/explorer-api/src/ping/http.rs b/explorer-api/src/ping/http.rs index e8e89ac218..4e12e0f085 100644 --- a/explorer-api/src/ping/http.rs +++ b/explorer-api/src/ping/http.rs @@ -1,7 +1,7 @@ // Copyright 2021-2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::{MixId, MixNode}; +use nym_mixnet_contract_common::{MixId, MixNode}; use rocket::serde::json::Json; use rocket::{Route, State}; use rocket_okapi::okapi::openapi3::OpenApi; diff --git a/explorer-api/src/ping/models.rs b/explorer-api/src/ping/models.rs index 9463e12bb6..9aebf7d5fd 100644 --- a/explorer-api/src/ping/models.rs +++ b/explorer-api/src/ping/models.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::sync::Arc; use std::time::{Duration, SystemTime}; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use serde::Deserialize; use serde::Serialize; use tokio::sync::RwLock; diff --git a/explorer-api/src/state.rs b/explorer-api/src/state.rs index a511d5c0b8..ff1f0b3d34 100644 --- a/explorer-api/src/state.rs +++ b/explorer-api/src/state.rs @@ -3,7 +3,7 @@ use std::path::Path; use chrono::{DateTime, Utc}; use log::info; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use serde::{Deserialize, Serialize}; use crate::client::ThreadsafeValidatorClient; diff --git a/explorer-api/src/tasks.rs b/explorer-api/src/tasks.rs index 6452405761..264240abf2 100644 --- a/explorer-api/src/tasks.rs +++ b/explorer-api/src/tasks.rs @@ -3,7 +3,7 @@ use std::future::Future; -use mixnet_contract_common::GatewayBond; +use nym_mixnet_contract_common::GatewayBond; use task::TaskClient; use validator_client::models::MixNodeBondAnnotated; use validator_client::nyxd::error::NyxdError; diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 52d4f36733..66d94cd1e8 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -56,7 +56,7 @@ build-information = { path = "../common/build-information" } coconut-interface = { path = "../common/coconut-interface" } credentials = { path = "../common/credentials" } config = { path = "../common/config" } -crypto = { path = "../common/crypto" } +nym-crypto = { path = "../common/crypto" } completions = { path = "../common/completions" } logging = { path = "../common/logging" } gateway-requests = { path = "gateway-requests" } @@ -64,7 +64,7 @@ mixnet-client = { path = "../common/client-libs/mixnet-client" } mixnode-common = { path = "../common/mixnode-common" } network-defaults = { path = "../common/network-defaults" } nymsphinx = { path = "../common/nymsphinx" } -pemstore = { path = "../common/pemstore" } +nym-pemstore = { path = "../common/pemstore" } statistics-common = { path = "../common/statistics" } nym-api-requests = { path = "../nym-api/nym-api-requests" } task = { path = "../common/task" } diff --git a/gateway/gateway-requests/Cargo.toml b/gateway/gateway-requests/Cargo.toml index b277e3f2de..0b2377c016 100644 --- a/gateway/gateway-requests/Cargo.toml +++ b/gateway/gateway-requests/Cargo.toml @@ -19,8 +19,8 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -crypto = { path = "../../common/crypto" } -pemstore = { path = "../../common/pemstore" } +nym-crypto = { path = "../../common/crypto" } +nym-pemstore = { path = "../../common/pemstore" } coconut-interface = { path = "../../common/coconut-interface" } credentials = { path = "../../common/credentials" } diff --git a/gateway/gateway-requests/src/authentication/encrypted_address.rs b/gateway/gateway-requests/src/authentication/encrypted_address.rs index c56d208013..c7015fe77d 100644 --- a/gateway/gateway-requests/src/authentication/encrypted_address.rs +++ b/gateway/gateway-requests/src/authentication/encrypted_address.rs @@ -3,7 +3,7 @@ use crate::iv::IV; use crate::registration::handshake::shared_key::SharedKeys; -use crypto::symmetric::stream_cipher; +use nym_crypto::symmetric::stream_cipher; use nymsphinx::params::GatewayEncryptionAlgorithm; use nymsphinx::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; use thiserror::Error; diff --git a/gateway/gateway-requests/src/iv.rs b/gateway/gateway-requests/src/iv.rs index 0a7d428f1c..2240a393c9 100644 --- a/gateway/gateway-requests/src/iv.rs +++ b/gateway/gateway-requests/src/iv.rs @@ -1,8 +1,8 @@ // Copyright 2020 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::generic_array::{typenum::Unsigned, GenericArray}; -use crypto::symmetric::stream_cipher::{random_iv, IvSizeUser, IV as CryptoIV}; +use nym_crypto::generic_array::{typenum::Unsigned, GenericArray}; +use nym_crypto::symmetric::stream_cipher::{random_iv, IvSizeUser, IV as CryptoIV}; use nymsphinx::params::GatewayEncryptionAlgorithm; use rand::{CryptoRng, RngCore}; use thiserror::Error; diff --git a/gateway/gateway-requests/src/lib.rs b/gateway/gateway-requests/src/lib.rs index d1c1861a8a..345da1bbeb 100644 --- a/gateway/gateway-requests/src/lib.rs +++ b/gateway/gateway-requests/src/lib.rs @@ -1,9 +1,9 @@ // Copyright 2020-2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -pub use crypto::generic_array; -use crypto::hmac::HmacOutput; -use crypto::OutputSizeUser; +pub use nym_crypto::generic_array; +use nym_crypto::hmac::HmacOutput; +use nym_crypto::OutputSizeUser; use nymsphinx::params::GatewayIntegrityHmacAlgorithm; pub use types::*; diff --git a/gateway/gateway-requests/src/registration/handshake/client.rs b/gateway/gateway-requests/src/registration/handshake/client.rs index 784364ebe2..4e3c865553 100644 --- a/gateway/gateway-requests/src/registration/handshake/client.rs +++ b/gateway/gateway-requests/src/registration/handshake/client.rs @@ -4,12 +4,12 @@ use crate::registration::handshake::shared_key::SharedKeys; use crate::registration::handshake::state::State; use crate::registration::handshake::{error::HandshakeError, WsItem}; -use crypto::asymmetric::encryption::PUBLIC_KEY_SIZE; -use crypto::asymmetric::identity::SIGNATURE_LENGTH; -use crypto::asymmetric::{encryption, identity}; use futures::future::BoxFuture; use futures::task::{Context, Poll}; use futures::{Future, Sink, Stream}; +use nym_crypto::asymmetric::encryption::PUBLIC_KEY_SIZE; +use nym_crypto::asymmetric::identity::SIGNATURE_LENGTH; +use nym_crypto::asymmetric::{encryption, identity}; use rand::{CryptoRng, RngCore}; use std::pin::Pin; use tungstenite::Message as WsMessage; @@ -22,7 +22,7 @@ impl<'a> ClientHandshake<'a> { pub(crate) fn new( rng: &mut (impl RngCore + CryptoRng), ws_stream: &'a mut S, - identity: &'a crypto::asymmetric::identity::KeyPair, + identity: &'a nym_crypto::asymmetric::identity::KeyPair, gateway_pubkey: identity::PublicKey, ) -> Self where diff --git a/gateway/gateway-requests/src/registration/handshake/error.rs b/gateway/gateway-requests/src/registration/handshake/error.rs index 81b2c2d0c7..798cd2ec55 100644 --- a/gateway/gateway-requests/src/registration/handshake/error.rs +++ b/gateway/gateway-requests/src/registration/handshake/error.rs @@ -1,7 +1,7 @@ // Copyright 2020 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use thiserror::Error; #[derive(Debug, Error)] diff --git a/gateway/gateway-requests/src/registration/handshake/gateway.rs b/gateway/gateway-requests/src/registration/handshake/gateway.rs index ace136d290..2afebbc115 100644 --- a/gateway/gateway-requests/src/registration/handshake/gateway.rs +++ b/gateway/gateway-requests/src/registration/handshake/gateway.rs @@ -4,10 +4,10 @@ use crate::registration::handshake::shared_key::SharedKeys; use crate::registration::handshake::state::State; use crate::registration::handshake::{error::HandshakeError, WsItem}; -use crypto::asymmetric::encryption; use futures::future::BoxFuture; use futures::task::{Context, Poll}; use futures::{Future, Sink, Stream}; +use nym_crypto::asymmetric::encryption; use rand::{CryptoRng, RngCore}; use std::pin::Pin; use tungstenite::Message as WsMessage; @@ -20,7 +20,7 @@ impl<'a> GatewayHandshake<'a> { pub(crate) fn new( rng: &mut (impl RngCore + CryptoRng), ws_stream: &'a mut S, - identity: &'a crypto::asymmetric::identity::KeyPair, + identity: &'a nym_crypto::asymmetric::identity::KeyPair, received_init_payload: Vec, ) -> Self where diff --git a/gateway/gateway-requests/src/registration/handshake/mod.rs b/gateway/gateway-requests/src/registration/handshake/mod.rs index 0b3b95bf7f..edf8a6fae0 100644 --- a/gateway/gateway-requests/src/registration/handshake/mod.rs +++ b/gateway/gateway-requests/src/registration/handshake/mod.rs @@ -6,8 +6,8 @@ use self::error::HandshakeError; #[cfg(not(target_arch = "wasm32"))] use self::gateway::GatewayHandshake; pub use self::shared_key::{SharedKeySize, SharedKeys}; -use crypto::asymmetric::identity; use futures::{Sink, Stream}; +use nym_crypto::asymmetric::identity; use rand::{CryptoRng, RngCore}; use tungstenite::{Error as WsError, Message as WsMessage}; diff --git a/gateway/gateway-requests/src/registration/handshake/shared_key.rs b/gateway/gateway-requests/src/registration/handshake/shared_key.rs index b030bfb67e..cea60afb1d 100644 --- a/gateway/gateway-requests/src/registration/handshake/shared_key.rs +++ b/gateway/gateway-requests/src/registration/handshake/shared_key.rs @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{GatewayMacSize, GatewayRequestsError}; -use crypto::generic_array::{ +use nym_crypto::generic_array::{ typenum::{Sum, Unsigned, U16}, GenericArray, }; -use crypto::hmac::{compute_keyed_hmac, recompute_keyed_hmac_and_verify_tag}; -use crypto::symmetric::stream_cipher::{self, CipherKey, KeySizeUser, IV}; +use nym_crypto::hmac::{compute_keyed_hmac, recompute_keyed_hmac_and_verify_tag}; +use nym_crypto::symmetric::stream_cipher::{self, CipherKey, KeySizeUser, IV}; +use nym_pemstore::traits::PemStorableKey; use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; -use pemstore::traits::PemStorableKey; use thiserror::Error; // shared key is as long as the encryption key and the MAC key combined. diff --git a/gateway/gateway-requests/src/registration/handshake/state.rs b/gateway/gateway-requests/src/registration/handshake/state.rs index 1560b5fd9f..c85c0fd3c5 100644 --- a/gateway/gateway-requests/src/registration/handshake/state.rs +++ b/gateway/gateway-requests/src/registration/handshake/state.rs @@ -5,14 +5,14 @@ use crate::registration::handshake::error::HandshakeError; use crate::registration::handshake::shared_key::{SharedKeySize, SharedKeys}; use crate::registration::handshake::WsItem; use crate::types; -use crypto::{ +use futures::{Sink, SinkExt, Stream, StreamExt}; +use log::*; +use nym_crypto::{ asymmetric::{encryption, identity}, generic_array::typenum::Unsigned, hkdf, symmetric::stream_cipher, }; -use futures::{Sink, SinkExt, Stream, StreamExt}; -use log::*; use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewaySharedKeyHkdfAlgorithm}; use rand::{CryptoRng, RngCore}; use std::convert::{TryFrom, TryInto}; diff --git a/gateway/gateway-requests/src/types.rs b/gateway/gateway-requests/src/types.rs index 3f882bedbd..00631e1f49 100644 --- a/gateway/gateway-requests/src/types.rs +++ b/gateway/gateway-requests/src/types.rs @@ -6,9 +6,9 @@ use crate::iv::IV; use crate::registration::handshake::SharedKeys; use crate::{GatewayMacSize, PROTOCOL_VERSION}; use coconut_interface::Credential; -use crypto::generic_array::typenum::Unsigned; -use crypto::hmac::recompute_keyed_hmac_and_verify_tag; -use crypto::symmetric::stream_cipher; +use nym_crypto::generic_array::typenum::Unsigned; +use nym_crypto::hmac::recompute_keyed_hmac_and_verify_tag; +use nym_crypto::symmetric::stream_cipher; use nymsphinx::addressing::nodes::NymNodeRoutingAddressError; use nymsphinx::forwarding::packet::{MixPacket, MixPacketFormattingError}; use nymsphinx::params::packet_sizes::PacketSize; diff --git a/gateway/src/commands/init.rs b/gateway/src/commands/init.rs index bdf3b2ce03..a21039cac6 100644 --- a/gateway/src/commands/init.rs +++ b/gateway/src/commands/init.rs @@ -8,7 +8,7 @@ use crate::{ }; use clap::Args; use config::NymConfig; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; use std::error::Error; use std::net::IpAddr; use std::path::PathBuf; @@ -126,18 +126,18 @@ pub async fn execute(args: Init, output: OutputFormat) -> Result<(), Box for SignedTarget { } pub fn load_identity_keys(pathfinder: &GatewayPathfinder) -> identity::KeyPair { - let identity_keypair: identity::KeyPair = pemstore::load_keypair(&pemstore::KeyPairPath::new( - pathfinder.private_identity_key().to_owned(), - pathfinder.public_identity_key().to_owned(), - )) - .expect("Failed to read stored identity key files"); + let identity_keypair: identity::KeyPair = + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( + pathfinder.private_identity_key().to_owned(), + pathfinder.public_identity_key().to_owned(), + )) + .expect("Failed to read stored identity key files"); identity_keypair } diff --git a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs index f6365376c5..3998ceed0d 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs @@ -5,7 +5,7 @@ use crate::node::client_handling::websocket::connection_handler::authenticated:: use bandwidth_claim_contract::msg::ExecuteMsg; use bandwidth_claim_contract::payment::LinkPaymentData; use credentials::token::bandwidth::TokenCredential; -use crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH}; +use nym_crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH}; use network_defaults::{ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH}; use std::str::FromStr; use validator_client::nxmd::traits::MixnetQueryClient; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index 527d17805a..96aa1bdcf3 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -8,7 +8,6 @@ use crate::node::client_handling::websocket::connection_handler::{ }; use crate::node::storage::error::StorageError; use crate::node::storage::Storage; -use crypto::asymmetric::identity; use futures::{channel::mpsc, SinkExt, StreamExt}; use gateway_requests::authentication::encrypted_address::{ EncryptedAddressBytes, EncryptedAddressConversionError, @@ -20,6 +19,7 @@ use gateway_requests::types::{ClientControlRequest, ServerResponse}; use gateway_requests::{BinaryResponse, PROTOCOL_VERSION}; use log::*; use mixnet_client::forwarder::MixForwardingSender; +use nym_crypto::asymmetric::identity; use nymsphinx::DestinationAddressBytes; use rand::{CryptoRng, Rng}; use std::convert::TryFrom; diff --git a/gateway/src/node/client_handling/websocket/listener.rs b/gateway/src/node/client_handling/websocket/listener.rs index 3fba1b389e..1cf3e68072 100644 --- a/gateway/src/node/client_handling/websocket/listener.rs +++ b/gateway/src/node/client_handling/websocket/listener.rs @@ -5,9 +5,9 @@ use crate::node::client_handling::active_clients::ActiveClientsStore; use crate::node::client_handling::websocket::connection_handler::coconut::CoconutVerifier; use crate::node::client_handling::websocket::connection_handler::FreshHandler; use crate::node::storage::Storage; -use crypto::asymmetric::identity; use log::*; use mixnet_client::forwarder::MixForwardingSender; +use nym_crypto::asymmetric::identity; use rand::rngs::OsRng; use std::net::SocketAddr; use std::process; diff --git a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs index a344f475f1..608627f91f 100644 --- a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs +++ b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs @@ -1,10 +1,10 @@ // Copyright 2020 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::encryption; use mixnode_common::packet_processor::error::MixProcessingError; pub use mixnode_common::packet_processor::processor::MixProcessingResult; use mixnode_common::packet_processor::processor::{ProcessedFinalHop, SphinxPacketProcessor}; +use nym_crypto::asymmetric::encryption; use nymsphinx::framing::packet::FramedSphinxPacket; use thiserror::Error; diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index 01b18dada0..6a3300affd 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -14,10 +14,10 @@ use crate::node::statistics::collector::GatewayStatisticsCollector; use crate::node::storage::Storage; use crate::{commands::sign::load_identity_keys, OutputFormat}; use colored::Colorize; -use crypto::asymmetric::{encryption, identity}; use log::*; use mixnet_client::forwarder::{MixForwardingSender, PacketForwarder}; use network_defaults::NymNetworkDetails; +use nym_crypto::asymmetric::{encryption, identity}; use rand::seq::SliceRandom; use rand::thread_rng; use statistics_common::collector::StatisticsSender; @@ -91,7 +91,7 @@ where fn load_identity_keys(pathfinder: &GatewayPathfinder) -> identity::KeyPair { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -101,7 +101,7 @@ where fn load_sphinx_keys(pathfinder: &GatewayPathfinder) -> encryption::KeyPair { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 66a21d7038..e4345a0c11 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -42,14 +42,14 @@ atty = "0.2" ## internal build-information = { path = "../common/build-information" } config = { path="../common/config" } -crypto = { path="../common/crypto" } +nym-crypto = { path="../common/crypto" } completions = { path="../common/completions" } logging = { path="../common/logging" } mixnet-client = { path="../common/client-libs/mixnet-client" } mixnode-common = { path="../common/mixnode-common" } nonexhaustive-delayqueue = { path="../common/nonexhaustive-delayqueue" } nymsphinx = { path="../common/nymsphinx" } -pemstore = { path="../common/pemstore" } +nym-pemstore = { path="../common/pemstore" } task = { path = "../common/task" } nym-types = { path = "../common/types" } topology = { path="../common/topology" } diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index fe6b18bc4f..4aa3f987df 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -8,7 +8,7 @@ use crate::OutputFormat; use crate::{commands::override_config, config::persistence::pathfinder::MixNodePathfinder}; use clap::Args; use config::NymConfig; -use crypto::asymmetric::{encryption, identity}; +use nym_crypto::asymmetric::{encryption, identity}; use std::net::IpAddr; use validator_client::nyxd; @@ -85,18 +85,18 @@ pub(crate) fn execute(args: &Init, output: OutputFormat) { let identity_keys = identity::KeyPair::new(&mut rng); let sphinx_keys = encryption::KeyPair::new(&mut rng); let pathfinder = MixNodePathfinder::new_from_config(&config); - pemstore::store_keypair( + nym_pemstore::store_keypair( &identity_keys, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), ), ) .expect("Failed to save identity keys"); - pemstore::store_keypair( + nym_pemstore::store_keypair( &sphinx_keys, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), ), diff --git a/mixnode/src/commands/mod.rs b/mixnode/src/commands/mod.rs index 30a1cacfaa..49d70a7f44 100644 --- a/mixnode/src/commands/mod.rs +++ b/mixnode/src/commands/mod.rs @@ -8,7 +8,7 @@ use colored::Colorize; use completions::{fig_generate, ArgShell}; use config::defaults::var_names::{BECH32_PREFIX, NYM_API}; use config::OptionalSet; -use crypto::bech32_address_validation; +use nym_crypto::bech32_address_validation; use std::net::IpAddr; use std::process; use validator_client::nyxd; diff --git a/mixnode/src/commands/sign.rs b/mixnode/src/commands/sign.rs index 52360d7a03..8c2882872e 100644 --- a/mixnode/src/commands/sign.rs +++ b/mixnode/src/commands/sign.rs @@ -9,8 +9,8 @@ use crate::node::MixNode; use anyhow::{anyhow, Result}; use clap::{ArgGroup, Args}; use config::NymConfig; -use crypto::asymmetric::identity; use log::error; +use nym_crypto::asymmetric::identity; use validator_client::nyxd; use super::version_check; diff --git a/mixnode/src/node/listener/connection_handler/packet_processing.rs b/mixnode/src/node/listener/connection_handler/packet_processing.rs index ac080a249a..d2794eeebb 100644 --- a/mixnode/src/node/listener/connection_handler/packet_processing.rs +++ b/mixnode/src/node/listener/connection_handler/packet_processing.rs @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 use crate::node::node_statistics; -use crypto::asymmetric::encryption; use mixnode_common::packet_processor::error::MixProcessingError; pub use mixnode_common::packet_processor::processor::MixProcessingResult; use mixnode_common::packet_processor::processor::SphinxPacketProcessor; +use nym_crypto::asymmetric::encryption; use nymsphinx::framing::packet::FramedSphinxPacket; // PacketProcessor contains all data required to correctly unwrap and forward sphinx packets diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index e581860fbd..4504029bd9 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -18,11 +18,11 @@ use crate::node::node_description::NodeDescription; use crate::node::node_statistics::SharedNodeStats; use crate::node::packet_delayforwarder::{DelayForwarder, PacketDelayForwardSender}; use crate::OutputFormat; -use ::crypto::asymmetric::{encryption, identity}; use colored::Colorize; use config::NymConfig; use log::{error, info, warn}; use mixnode_common::verloc::{self, AtomicVerlocResult, VerlocMeasurer}; +use nym_crypto::asymmetric::{encryption, identity}; use rand::seq::SliceRandom; use rand::thread_rng; use std::net::SocketAddr; @@ -65,7 +65,7 @@ impl MixNode { /// Loads identity keys stored on disk pub(crate) fn load_identity_keys(pathfinder: &MixNodePathfinder) -> identity::KeyPair { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -76,7 +76,7 @@ impl MixNode { /// Loads Sphinx keys stored on disk fn load_sphinx_keys(pathfinder: &MixNodePathfinder) -> encryption::KeyPair { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 6378976a15..61b524092f 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -73,20 +73,20 @@ config = { path = "../common/config" } cosmwasm-std = "1.0.0" credential-storage = { path = "../common/credential-storage" } credentials = { path = "../common/credentials" } -crypto = { path = "../common/crypto" } +nym-crypto = { path = "../common/crypto" } logging = { path = "../common/logging"} cw3 = { version = "0.13.4" } cw4 = { version = "0.13.4" } dkg = { path = "../common/crypto/dkg" } gateway-client = { path = "../common/client-libs/gateway-client" } inclusion-probability = { path = "../common/inclusion-probability" } -mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path = "../common/cosmwasm-smart-contracts/vesting-contract" } -contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common", features = ["dkg"] } +nym-mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } +nym-vesting-contract-common = { path = "../common/cosmwasm-smart-contracts/vesting-contract" } +nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common", features = ["dkg"] } multisig-contract-common = { path = "../common/cosmwasm-smart-contracts/multisig-contract" } nymcoconut = { path = "../common/nymcoconut" } nymsphinx = { path = "../common/nymsphinx" } -pemstore = { path = "../common/pemstore" } +nym-pemstore = { path = "../common/pemstore" } task = { path = "../common/task" } topology = { path = "../common/topology" } nym-api-requests = { path = "nym-api-requests" } diff --git a/nym-api/nym-api-requests/Cargo.toml b/nym-api/nym-api-requests/Cargo.toml index 1524142960..8290327315 100644 --- a/nym-api/nym-api-requests/Cargo.toml +++ b/nym-api/nym-api-requests/Cargo.toml @@ -15,7 +15,7 @@ serde = { version = "1.0", features = ["derive"] } ts-rs = { version = "6.1.2", optional = true } coconut-interface = { path = "../../common/coconut-interface" } -mixnet-contract-common = { path= "../../common/cosmwasm-smart-contracts/mixnet-contract" } +nym-mixnet-contract-common = { path= "../../common/cosmwasm-smart-contracts/mixnet-contract" } [features] default = [] diff --git a/nym-api/nym-api-requests/src/models.rs b/nym-api/nym-api-requests/src/models.rs index e241fad0e1..0954d4b9d6 100644 --- a/nym-api/nym-api-requests/src/models.rs +++ b/nym-api/nym-api-requests/src/models.rs @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use cosmwasm_std::{Coin, Decimal}; -use mixnet_contract_common::families::FamilyHead; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::reward_params::{Performance, RewardingParams}; -use mixnet_contract_common::rewarding::RewardEstimate; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::families::FamilyHead; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::reward_params::{Performance, RewardingParams}; +use nym_mixnet_contract_common::rewarding::RewardEstimate; +use nym_mixnet_contract_common::{ GatewayBond, IdentityKey, Interval, MixId, MixNode, Percent, RewardedSetNodeStatus, }; use schemars::JsonSchema; diff --git a/nym-api/src/circulating_supply_api/cache/refresher.rs b/nym-api/src/circulating_supply_api/cache/refresher.rs index 7f621053b9..75f6e5cdc2 100644 --- a/nym-api/src/circulating_supply_api/cache/refresher.rs +++ b/nym-api/src/circulating_supply_api/cache/refresher.rs @@ -4,7 +4,7 @@ use super::CirculatingSupplyCache; use crate::circulating_supply_api::cache::CirculatingSupplyCacheError; use crate::support::nyxd::Client; -use contracts_common::truncate_decimal; +use nym_contracts_common::truncate_decimal; use std::collections::HashSet; use std::sync::atomic::Ordering; use std::time::Duration; diff --git a/nym-api/src/coconut/client.rs b/nym-api/src/coconut/client.rs index 28b51fd252..0d81e52001 100644 --- a/nym-api/src/coconut/client.rs +++ b/nym-api/src/coconut/client.rs @@ -8,10 +8,10 @@ use coconut_dkg_common::types::{ EncodedBTEPublicKeyWithProof, Epoch, EpochId, InitialReplacementData, }; use coconut_dkg_common::verification_key::{ContractVKShare, VerificationKeyShare}; -use contracts_common::dealings::ContractSafeBytes; use cw3::ProposalResponse; use cw4::MemberResponse; use dkg::Threshold; +use nym_contracts_common::dealings::ContractSafeBytes; use validator_client::nyxd::cosmwasm_client::types::ExecuteResult; use validator_client::nyxd::{AccountId, Fee, TxResponse}; diff --git a/nym-api/src/coconut/deposit.rs b/nym-api/src/coconut/deposit.rs index 06656ab725..b6b472288f 100644 --- a/nym-api/src/coconut/deposit.rs +++ b/nym-api/src/coconut/deposit.rs @@ -6,9 +6,9 @@ use coconut_bandwidth_contract_common::events::{ DEPOSIT_VALUE, }; use credentials::coconut::bandwidth::BandwidthVoucher; -use crypto::asymmetric::encryption; -use crypto::asymmetric::identity::{self, Signature}; use nym_api_requests::coconut::BlindSignRequestBody; +use nym_crypto::asymmetric::encryption; +use nym_crypto::asymmetric::identity::{self, Signature}; use validator_client::nyxd::TxResponse; use super::error::{CoconutError, Result}; @@ -168,7 +168,7 @@ mod test { assert!(matches!( err, CoconutError::Ed25519ParseError( - crypto::asymmetric::identity::Ed25519RecoveryError::MalformedSignatureString { .. } + nym_crypto::asymmetric::identity::Ed25519RecoveryError::MalformedSignatureString { .. } ) )); @@ -279,7 +279,7 @@ mod test { assert!(matches!( err, CoconutError::Ed25519ParseError( - crypto::asymmetric::identity::Ed25519RecoveryError::MalformedPublicKeyString { .. } + nym_crypto::asymmetric::identity::Ed25519RecoveryError::MalformedPublicKeyString { .. } ) )); @@ -334,7 +334,7 @@ mod test { assert!(matches!( err, CoconutError::X25519ParseError( - crypto::asymmetric::encryption::KeyRecoveryError::MalformedPublicKeyString { .. } + nym_crypto::asymmetric::encryption::KeyRecoveryError::MalformedPublicKeyString { .. } ) )); @@ -365,7 +365,7 @@ mod test { assert_eq!( err.to_string(), CoconutError::SignatureVerificationError( - crypto::asymmetric::identity::SignatureError::default(), + nym_crypto::asymmetric::identity::SignatureError::default(), ) .to_string(), ); diff --git a/nym-api/src/coconut/dkg/client.rs b/nym-api/src/coconut/dkg/client.rs index 6768622b87..f84498a36f 100644 --- a/nym-api/src/coconut/dkg/client.rs +++ b/nym-api/src/coconut/dkg/client.rs @@ -8,10 +8,10 @@ use coconut_dkg_common::types::{ EncodedBTEPublicKeyWithProof, Epoch, EpochId, InitialReplacementData, NodeIndex, }; use coconut_dkg_common::verification_key::{ContractVKShare, VerificationKeyShare}; -use contracts_common::dealings::ContractSafeBytes; use cw3::ProposalResponse; use cw4::MemberResponse; use dkg::Threshold; +use nym_contracts_common::dealings::ContractSafeBytes; use validator_client::nyxd::cosmwasm_client::logs::{find_attribute, NODE_INDEX}; use validator_client::nyxd::cosmwasm_client::types::ExecuteResult; use validator_client::nyxd::AccountId; diff --git a/nym-api/src/coconut/dkg/controller.rs b/nym-api/src/coconut/dkg/controller.rs index 9c926a7d27..26f693e73b 100644 --- a/nym-api/src/coconut/dkg/controller.rs +++ b/nym-api/src/coconut/dkg/controller.rs @@ -27,9 +27,9 @@ pub(crate) fn init_keypair(config: &Config) -> Result<()> { let mut rng = OsRng; let dkg_params = dkg::bte::setup(); let kp = DkgKeyPair::new(&dkg_params, &mut rng); - pemstore::store_keypair( + nym_pemstore::store_keypair( &kp, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( config.decryption_key_path(), config.public_key_with_proof_path(), ), @@ -53,14 +53,16 @@ impl DkgController { coconut_keypair: CoconutKeyPair, rng: R, ) -> Result { - let dkg_keypair = pemstore::load_keypair(&pemstore::KeyPairPath::new( + let dkg_keypair = nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( config.decryption_key_path(), config.public_key_with_proof_path(), ))?; - if let Ok(coconut_keypair_value) = pemstore::load_keypair(&pemstore::KeyPairPath::new( - config.secret_key_path(), - config.verification_key_path(), - )) { + if let Ok(coconut_keypair_value) = + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( + config.secret_key_path(), + config.verification_key_path(), + )) + { coconut_keypair.set(Some(coconut_keypair_value)).await; } let persistent_state = @@ -114,7 +116,7 @@ impl DkgController { .await } EpochState::VerificationKeySubmission { resharing } => { - let keypair_path = pemstore::KeyPairPath::new( + let keypair_path = nym_pemstore::KeyPairPath::new( self.secret_key_path.clone(), self.verification_key_path.clone(), ); diff --git a/nym-api/src/coconut/dkg/dealing.rs b/nym-api/src/coconut/dkg/dealing.rs index 85ed717ac4..f4e01b57cc 100644 --- a/nym-api/src/coconut/dkg/dealing.rs +++ b/nym-api/src/coconut/dkg/dealing.rs @@ -5,9 +5,9 @@ use crate::coconut::dkg::client::DkgClient; use crate::coconut::dkg::state::{ConsistentState, State}; use crate::coconut::error::CoconutError; use coconut_dkg_common::types::TOTAL_DEALINGS; -use contracts_common::dealings::ContractSafeBytes; use dkg::bte::setup; use dkg::Dealing; +use nym_contracts_common::dealings::ContractSafeBytes; use rand::RngCore; use std::collections::VecDeque; diff --git a/nym-api/src/coconut/dkg/verification_key.rs b/nym-api/src/coconut/dkg/verification_key.rs index 892162dced..b7ef1e2773 100644 --- a/nym-api/src/coconut/dkg/verification_key.rs +++ b/nym-api/src/coconut/dkg/verification_key.rs @@ -16,9 +16,9 @@ use cw3::{ProposalResponse, Status}; use dkg::bte::{decrypt_share, setup}; use dkg::error::DkgError; use dkg::{combine_shares, try_recover_verification_keys, Dealing, Threshold}; +use nym_pemstore::KeyPairPath; use nymcoconut::tests::helpers::transpose_matrix; use nymcoconut::{check_vk_pairing, Base58, KeyPair, Parameters, SecretKey, VerificationKey}; -use pemstore::KeyPairPath; use std::collections::BTreeMap; use validator_client::nyxd::cosmwasm_client::logs::find_attribute; @@ -160,7 +160,7 @@ pub(crate) async fn verification_key_submission( deterministic_filter_dealers(dkg_client, state, threshold, resharing).await?; let coconut_keypair = derive_partial_keypair(state, threshold, dealings_maps)?; let vk_share = coconut_keypair.verification_key().to_bs58(); - pemstore::store_keypair(&coconut_keypair, keypair_path)?; + nym_pemstore::store_keypair(&coconut_keypair, keypair_path)?; let res = dkg_client .submit_verification_key_share(vk_share, resharing) .await?; @@ -280,8 +280,8 @@ pub(crate) mod tests { use coconut_dkg_common::dealer::DealerDetails; use coconut_dkg_common::types::InitialReplacementData; use coconut_dkg_common::verification_key::ContractVKShare; - use contracts_common::dealings::ContractSafeBytes; use dkg::bte::keys::KeyPair as DkgKeyPair; + use nym_contracts_common::dealings::ContractSafeBytes; use nymcoconut::aggregate_verification_keys; use rand::rngs::OsRng; use rand::Rng; diff --git a/nym-api/src/coconut/error.rs b/nym-api/src/coconut/error.rs index 9a252c95c2..20a3c919dc 100644 --- a/nym-api/src/coconut/error.rs +++ b/nym-api/src/coconut/error.rs @@ -7,11 +7,11 @@ use rocket::{response, Request, Response}; use std::io::Cursor; use thiserror::Error; -use crypto::asymmetric::{ +use dkg::error::DkgError; +use nym_crypto::asymmetric::{ encryption::KeyRecoveryError, identity::{Ed25519RecoveryError, SignatureError}, }; -use dkg::error::DkgError; use validator_client::nyxd::error::NyxdError; use crate::node_status_api::models::NymApiStorageError; diff --git a/nym-api/src/coconut/mod.rs b/nym-api/src/coconut/mod.rs index eb2063e698..0751d1c3b3 100644 --- a/nym-api/src/coconut/mod.rs +++ b/nym-api/src/coconut/mod.rs @@ -19,14 +19,14 @@ use config::defaults::NYM_API_VERSION; use credentials::coconut::params::{ NymApiCredentialEncryptionAlgorithm, NymApiCredentialHkdfAlgorithm, }; -use crypto::asymmetric::encryption; -use crypto::shared_key::new_ephemeral_shared_key; -use crypto::symmetric::stream_cipher; use getset::{CopyGetters, Getters}; use keypair::KeyPair; use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; +use nym_crypto::asymmetric::encryption; +use nym_crypto::shared_key::new_ephemeral_shared_key; +use nym_crypto::symmetric::stream_cipher; use rand_07::rngs::OsRng; use rocket::fairing::AdHoc; use rocket::serde::json::Json; diff --git a/nym-api/src/coconut/tests.rs b/nym-api/src/coconut/tests.rs index 75d9cae05e..a8168ab63d 100644 --- a/nym-api/src/coconut/tests.rs +++ b/nym-api/src/coconut/tests.rs @@ -17,11 +17,11 @@ use credentials::coconut::bandwidth::BandwidthVoucher; use credentials::coconut::params::{ NymApiCredentialEncryptionAlgorithm, NymApiCredentialHkdfAlgorithm, }; -use crypto::shared_key::recompute_shared_key; -use crypto::symmetric::stream_cipher; use nym_api_requests::coconut::{ BlindSignRequestBody, BlindedSignatureResponse, VerifyCredentialBody, VerifyCredentialResponse, }; +use nym_crypto::shared_key::recompute_shared_key; +use nym_crypto::symmetric::stream_cipher; use nymcoconut::tests::helpers::theta_from_keys_and_attributes; use nymcoconut::{ prepare_blind_sign, ttp_keygen, Base58, BlindSignRequest, BlindedSignature, Parameters, @@ -43,11 +43,11 @@ use coconut_dkg_common::types::{ EncodedBTEPublicKeyWithProof, Epoch, EpochId, InitialReplacementData, TOTAL_DEALINGS, }; use coconut_dkg_common::verification_key::{ContractVKShare, VerificationKeyShare}; -use contracts_common::dealings::ContractSafeBytes; -use crypto::asymmetric::{encryption, identity}; use cw3::ProposalResponse; use cw4::MemberResponse; use dkg::Threshold; +use nym_contracts_common::dealings::ContractSafeBytes; +use nym_crypto::asymmetric::{encryption, identity}; use rand_07::rngs::OsRng; use rand_07::Rng; use rocket::http::Status; @@ -622,7 +622,7 @@ async fn state_functions() { expected_response.to_bytes() ); - let encryption_keypair = crypto::asymmetric::encryption::KeyPair::new(&mut OsRng); + let encryption_keypair = nym_crypto::asymmetric::encryption::KeyPair::new(&mut OsRng); let blinded_signature = BlindedSignature::from_bytes(&[ 183, 217, 166, 113, 40, 123, 74, 25, 72, 31, 136, 19, 125, 95, 217, 228, 96, 113, 25, 240, 12, 102, 125, 11, 174, 20, 216, 82, 192, 71, 27, 194, 48, 20, 17, 95, 243, 179, 82, 21, 57, @@ -656,7 +656,7 @@ async fn state_functions() { .await .unwrap(); let remote_key = - crypto::asymmetric::encryption::PublicKey::from_bytes(&response.remote_key).unwrap(); + nym_crypto::asymmetric::encryption::PublicKey::from_bytes(&response.remote_key).unwrap(); let encryption_key = recompute_shared_key::< NymApiCredentialEncryptionAlgorithm, diff --git a/nym-api/src/epoch_operations/mod.rs b/nym-api/src/epoch_operations/mod.rs index dd6666ba68..f4e13d691f 100644 --- a/nym-api/src/epoch_operations/mod.rs +++ b/nym-api/src/epoch_operations/mod.rs @@ -19,11 +19,11 @@ use crate::support::nyxd::Client; use crate::support::storage::models::RewardingReport; use crate::support::storage::NymApiStorage; use error::RewardingError; -use mixnet_contract_common::families::FamilyHead; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::families::FamilyHead; +use nym_mixnet_contract_common::{ reward_params::Performance, CurrentIntervalResponse, ExecuteMsg, Interval, MixId, }; -use mixnet_contract_common::{IdentityKey, Layer, LayerAssignment, MixNodeDetails}; +use nym_mixnet_contract_common::{IdentityKey, Layer, LayerAssignment, MixNodeDetails}; use rand::prelude::SliceRandom; use rand::rngs::OsRng; use std::collections::HashMap; diff --git a/nym-api/src/network_monitor/gateways_reader.rs b/nym-api/src/network_monitor/gateways_reader.rs index 53c0fd224c..84407272b0 100644 --- a/nym-api/src/network_monitor/gateways_reader.rs +++ b/nym-api/src/network_monitor/gateways_reader.rs @@ -1,8 +1,8 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity; use gateway_client::{AcknowledgementReceiver, MixnetMessageReceiver}; +use nym_crypto::asymmetric::identity; use tokio_stream::StreamMap; pub(crate) type GatewayMessages = Vec>; diff --git a/nym-api/src/network_monitor/mod.rs b/nym-api/src/network_monitor/mod.rs index f062679da4..49ceca5768 100644 --- a/nym-api/src/network_monitor/mod.rs +++ b/nym-api/src/network_monitor/mod.rs @@ -17,9 +17,9 @@ use crate::storage::NymApiStorage; use crate::support::config::Config; use crate::support::nyxd; use credential_storage::PersistentStorage; -use crypto::asymmetric::{encryption, identity}; use futures::channel::mpsc; use gateway_client::bandwidth::BandwidthController; +use nym_crypto::asymmetric::{encryption, identity}; use std::sync::Arc; use task::TaskManager; use validator_client::nyxd::SigningNyxdClient; diff --git a/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs b/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs index 8d0551d608..1b1b46a84c 100644 --- a/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs +++ b/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs @@ -1,8 +1,8 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use crypto::asymmetric::identity::PUBLIC_KEY_LENGTH; use gateway_client::GatewayClient; +use nym_crypto::asymmetric::identity::PUBLIC_KEY_LENGTH; use std::collections::HashMap; use std::sync::Arc; use tokio::sync::{Mutex, MutexGuard, TryLockError}; diff --git a/nym-api/src/network_monitor/monitor/gateways_pinger.rs b/nym-api/src/network_monitor/monitor/gateways_pinger.rs index 986c1db5fb..e3ad14a77b 100644 --- a/nym-api/src/network_monitor/monitor/gateways_pinger.rs +++ b/nym-api/src/network_monitor/monitor/gateways_pinger.rs @@ -3,9 +3,9 @@ use crate::network_monitor::monitor::gateway_clients_cache::ActiveGatewayClients; use crate::network_monitor::monitor::receiver::{GatewayClientUpdate, GatewayClientUpdateSender}; -use crypto::asymmetric::identity; -use crypto::asymmetric::identity::PUBLIC_KEY_LENGTH; use log::{debug, info, trace, warn}; +use nym_crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity::PUBLIC_KEY_LENGTH; use std::time::Duration; use task::TaskClient; use tokio::time::{sleep, Instant}; diff --git a/nym-api/src/network_monitor/monitor/preparer.rs b/nym-api/src/network_monitor/monitor/preparer.rs index 4cff6f31e6..7393b5c303 100644 --- a/nym-api/src/network_monitor/monitor/preparer.rs +++ b/nym-api/src/network_monitor/monitor/preparer.rs @@ -6,9 +6,9 @@ use crate::network_monitor::monitor::sender::GatewayPackets; use crate::network_monitor::test_packet::{NodeType, TestPacket}; use crate::network_monitor::test_route::TestRoute; use crate::nym_contract_cache::cache::NymContractCache; -use crypto::asymmetric::{encryption, identity}; use log::info; -use mixnet_contract_common::{Addr, GatewayBond, Layer, MixId, MixNodeBond}; +use nym_crypto::asymmetric::{encryption, identity}; +use nym_mixnet_contract_common::{Addr, GatewayBond, Layer, MixId, MixNodeBond}; use nymsphinx::addressing::clients::Recipient; use nymsphinx::forwarding::packet::MixPacket; use rand::seq::SliceRandom; diff --git a/nym-api/src/network_monitor/monitor/processor.rs b/nym-api/src/network_monitor/monitor/processor.rs index 4a86c52612..81a1ff1fcb 100644 --- a/nym-api/src/network_monitor/monitor/processor.rs +++ b/nym-api/src/network_monitor/monitor/processor.rs @@ -4,11 +4,11 @@ use crate::network_monitor::gateways_reader::GatewayMessages; use crate::network_monitor::test_packet::{TestPacket, TestPacketError}; use crate::network_monitor::ROUTE_TESTING_TEST_NONCE; -use crypto::asymmetric::encryption; use futures::channel::mpsc; use futures::lock::{Mutex, MutexGuard}; use futures::{SinkExt, StreamExt}; use log::warn; +use nym_crypto::asymmetric::encryption; use nymsphinx::receiver::{MessageReceiver, MessageRecoveryError}; use std::mem; use std::sync::Arc; diff --git a/nym-api/src/network_monitor/monitor/receiver.rs b/nym-api/src/network_monitor/monitor/receiver.rs index c232458c6f..f9b45f402e 100644 --- a/nym-api/src/network_monitor/monitor/receiver.rs +++ b/nym-api/src/network_monitor/monitor/receiver.rs @@ -3,10 +3,10 @@ use crate::network_monitor::gateways_reader::{GatewayMessages, GatewaysReader}; use crate::network_monitor::monitor::processor::ReceivedProcessorSender; -use crypto::asymmetric::identity; use futures::channel::mpsc; use futures::StreamExt; use gateway_client::{AcknowledgementReceiver, MixnetMessageReceiver}; +use nym_crypto::asymmetric::identity; use task::TaskClient; pub(crate) type GatewayClientUpdateSender = mpsc::UnboundedSender; diff --git a/nym-api/src/network_monitor/monitor/sender.rs b/nym-api/src/network_monitor/monitor/sender.rs index 9fde853c77..4cf6fc33ce 100644 --- a/nym-api/src/network_monitor/monitor/sender.rs +++ b/nym-api/src/network_monitor/monitor/sender.rs @@ -8,7 +8,6 @@ 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 crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH}; use futures::channel::mpsc; use futures::stream::{self, FuturesUnordered, StreamExt}; use futures::task::Context; @@ -16,6 +15,7 @@ use futures::{Future, Stream}; use gateway_client::error::GatewayClientError; use gateway_client::{AcknowledgementReceiver, GatewayClient, MixnetMessageReceiver}; use log::{debug, info, trace, warn}; +use nym_crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH}; use nymsphinx::forwarding::packet::MixPacket; use pin_project::pin_project; use std::mem; diff --git a/nym-api/src/network_monitor/monitor/summary_producer.rs b/nym-api/src/network_monitor/monitor/summary_producer.rs index 0262dba4fb..704084c338 100644 --- a/nym-api/src/network_monitor/monitor/summary_producer.rs +++ b/nym-api/src/network_monitor/monitor/summary_producer.rs @@ -4,7 +4,7 @@ use crate::network_monitor::monitor::preparer::{InvalidNode, TestedNode}; use crate::network_monitor::test_packet::{NodeType, TestPacket}; use crate::network_monitor::test_route::TestRoute; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use std::collections::HashMap; use std::fmt::{Display, Formatter}; diff --git a/nym-api/src/network_monitor/test_packet.rs b/nym-api/src/network_monitor/test_packet.rs index 4806c3efe4..687eb0cf93 100644 --- a/nym-api/src/network_monitor/test_packet.rs +++ b/nym-api/src/network_monitor/test_packet.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use crate::network_monitor::monitor::preparer::TestedNode; -use crypto::asymmetric::identity; -use crypto::asymmetric::identity::Ed25519RecoveryError; -use mixnet_contract_common::MixId; +use nym_crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity::Ed25519RecoveryError; +use nym_mixnet_contract_common::MixId; use std::convert::TryInto; use std::fmt::{self, Display, Formatter}; use std::hash::{Hash, Hasher}; diff --git a/nym-api/src/network_monitor/test_route/mod.rs b/nym-api/src/network_monitor/test_route/mod.rs index 3fbf89854f..5f32610a03 100644 --- a/nym-api/src/network_monitor/test_route/mod.rs +++ b/nym-api/src/network_monitor/test_route/mod.rs @@ -3,7 +3,7 @@ use crate::network_monitor::test_packet::{NodeType, TestPacket}; use crate::network_monitor::ROUTE_TESTING_TEST_NONCE; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use std::fmt::{Debug, Formatter}; use topology::{gateway, mix, NymTopology}; diff --git a/nym-api/src/node_status_api/cache/inclusion_probabilities.rs b/nym-api/src/node_status_api/cache/inclusion_probabilities.rs index 80643dae27..584b06801a 100644 --- a/nym-api/src/node_status_api/cache/inclusion_probabilities.rs +++ b/nym-api/src/node_status_api/cache/inclusion_probabilities.rs @@ -1,6 +1,6 @@ -use contracts_common::truncate_decimal; -use mixnet_contract_common::{MixId, MixNodeDetails, RewardingParams}; use nym_api_requests::models::InclusionProbability; +use nym_contracts_common::truncate_decimal; +use nym_mixnet_contract_common::{MixId, MixNodeDetails, RewardingParams}; use serde::Serialize; use std::time::Duration; use tap::TapFallible; diff --git a/nym-api/src/node_status_api/cache/mod.rs b/nym-api/src/node_status_api/cache/mod.rs index 1d3d94fbc6..d996fbb69b 100644 --- a/nym-api/src/node_status_api/cache/mod.rs +++ b/nym-api/src/node_status_api/cache/mod.rs @@ -5,8 +5,8 @@ use crate::support::caching::Cache; use self::data::NodeStatusCacheData; use self::inclusion_probabilities::InclusionProbabilities; -use mixnet_contract_common::MixId; use nym_api_requests::models::{GatewayBondAnnotated, MixNodeBondAnnotated, MixnodeStatus}; +use nym_mixnet_contract_common::MixId; use rocket::fairing::AdHoc; use std::{sync::Arc, time::Duration}; use thiserror::Error; diff --git a/nym-api/src/node_status_api/cache/node_sets.rs b/nym-api/src/node_status_api/cache/node_sets.rs index be017c10de..11e622052e 100644 --- a/nym-api/src/node_status_api/cache/node_sets.rs +++ b/nym-api/src/node_status_api/cache/node_sets.rs @@ -1,11 +1,11 @@ use crate::node_status_api::reward_estimate::{compute_apy_from_reward, compute_reward_estimate}; use crate::support::storage::NymApiStorage; -use mixnet_contract_common::families::FamilyHead; -use mixnet_contract_common::{reward_params::Performance, Interval, MixId}; -use mixnet_contract_common::{ +use nym_api_requests::models::{GatewayBondAnnotated, MixNodeBondAnnotated}; +use nym_mixnet_contract_common::families::FamilyHead; +use nym_mixnet_contract_common::{reward_params::Performance, Interval, MixId}; +use nym_mixnet_contract_common::{ GatewayBond, IdentityKey, MixNodeDetails, RewardedSetNodeStatus, RewardingParams, }; -use nym_api_requests::models::{GatewayBondAnnotated, MixNodeBondAnnotated}; use std::collections::HashMap; pub(super) fn to_rewarded_set_node_status( diff --git a/nym-api/src/node_status_api/helpers.rs b/nym-api/src/node_status_api/helpers.rs index 0208d09140..2c6a03b678 100644 --- a/nym-api/src/node_status_api/helpers.rs +++ b/nym-api/src/node_status_api/helpers.rs @@ -6,14 +6,14 @@ use crate::storage::NymApiStorage; use crate::support::caching::Cache; use crate::{NodeStatusCache, NymContractCache}; use cosmwasm_std::Decimal; -use mixnet_contract_common::reward_params::Performance; -use mixnet_contract_common::{Interval, MixId, RewardedSetNodeStatus}; use nym_api_requests::models::{ AllInclusionProbabilitiesResponse, ComputeRewardEstParam, GatewayBondAnnotated, InclusionProbabilityResponse, MixNodeBondAnnotated, MixnodeCoreStatusResponse, MixnodeStatusReportResponse, MixnodeStatusResponse, MixnodeUptimeHistoryResponse, RewardEstimationResponse, StakeSaturationResponse, UptimeResponse, }; +use nym_mixnet_contract_common::reward_params::Performance; +use nym_mixnet_contract_common::{Interval, MixId, RewardedSetNodeStatus}; use rocket::http::Status; use rocket::State; diff --git a/nym-api/src/node_status_api/models.rs b/nym-api/src/node_status_api/models.rs index 43a11627b3..c65397a1f2 100644 --- a/nym-api/src/node_status_api/models.rs +++ b/nym-api/src/node_status_api/models.rs @@ -3,12 +3,12 @@ use crate::node_status_api::utils::NodeUptimes; use crate::storage::models::NodeStatus; -use mixnet_contract_common::reward_params::Performance; -use mixnet_contract_common::{IdentityKey, MixId}; use nym_api_requests::models::{ GatewayStatusReportResponse, GatewayUptimeHistoryResponse, HistoricalUptimeResponse, MixnodeStatusReportResponse, MixnodeUptimeHistoryResponse, RequestError, }; +use nym_mixnet_contract_common::reward_params::Performance; +use nym_mixnet_contract_common::{IdentityKey, MixId}; use okapi::openapi3::{Responses, SchemaObject}; use rocket::http::Status; use rocket::response::{self, Responder, Response}; diff --git a/nym-api/src/node_status_api/reward_estimate.rs b/nym-api/src/node_status_api/reward_estimate.rs index 33bbd8320c..744ce1bb4e 100644 --- a/nym-api/src/node_status_api/reward_estimate.rs +++ b/nym-api/src/node_status_api/reward_estimate.rs @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 use cosmwasm_std::Decimal; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::reward_params::{NodeRewardParams, Performance, RewardingParams}; -use mixnet_contract_common::rewarding::RewardEstimate; -use mixnet_contract_common::{Interval, RewardedSetNodeStatus}; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::reward_params::{NodeRewardParams, Performance, RewardingParams}; +use nym_mixnet_contract_common::rewarding::RewardEstimate; +use nym_mixnet_contract_common::{Interval, RewardedSetNodeStatus}; fn compute_apy(epochs_in_year: Decimal, reward: Decimal, pledge_amount: Decimal) -> Decimal { if pledge_amount.is_zero() { diff --git a/nym-api/src/node_status_api/routes.rs b/nym-api/src/node_status_api/routes.rs index 4a11c84527..a5bd3b7b6e 100644 --- a/nym-api/src/node_status_api/routes.rs +++ b/nym-api/src/node_status_api/routes.rs @@ -13,7 +13,6 @@ use crate::node_status_api::helpers::{ use crate::node_status_api::models::ErrorResponse; use crate::storage::NymApiStorage; use crate::NymContractCache; -use mixnet_contract_common::MixId; use nym_api_requests::models::{ AllInclusionProbabilitiesResponse, ComputeRewardEstParam, GatewayBondAnnotated, GatewayCoreStatusResponse, GatewayStatusReportResponse, GatewayUptimeHistoryResponse, @@ -21,6 +20,7 @@ use nym_api_requests::models::{ MixnodeStatusReportResponse, MixnodeStatusResponse, MixnodeUptimeHistoryResponse, RewardEstimationResponse, StakeSaturationResponse, UptimeResponse, }; +use nym_mixnet_contract_common::MixId; use rocket::http::Status; use rocket::serde::json::Json; use rocket::State; diff --git a/nym-api/src/node_status_api/utils.rs b/nym-api/src/node_status_api/utils.rs index 72f3fc3785..da824188b9 100644 --- a/nym-api/src/node_status_api/utils.rs +++ b/nym-api/src/node_status_api/utils.rs @@ -5,7 +5,7 @@ use crate::node_status_api::models::Uptime; use crate::node_status_api::{FIFTEEN_MINUTES, ONE_HOUR}; use crate::storage::models::NodeStatus; use log::warn; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use std::convert::TryInto; use time::OffsetDateTime; diff --git a/nym-api/src/nym_contract_cache/cache/data.rs b/nym-api/src/nym_contract_cache/cache/data.rs index 8026229e08..2188373585 100644 --- a/nym-api/src/nym_contract_cache/cache/data.rs +++ b/nym-api/src/nym_contract_cache/cache/data.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::support::caching::Cache; -use mixnet_contract_common::{ +use nym_mixnet_contract_common::{ families::FamilyHead, GatewayBond, IdentityKey, Interval, MixId, MixNodeDetails, RewardingParams, }; diff --git a/nym-api/src/nym_contract_cache/cache/mod.rs b/nym-api/src/nym_contract_cache/cache/mod.rs index fa6b392675..1ee787af17 100644 --- a/nym-api/src/nym_contract_cache/cache/mod.rs +++ b/nym-api/src/nym_contract_cache/cache/mod.rs @@ -1,10 +1,10 @@ use crate::support::caching::Cache; use data::ValidatorCacheData; -use mixnet_contract_common::{ +use nym_api_requests::models::MixnodeStatus; +use nym_mixnet_contract_common::{ families::FamilyHead, GatewayBond, IdentityKey, Interval, MixId, MixNodeBond, MixNodeDetails, RewardingParams, }; -use nym_api_requests::models::MixnodeStatus; use rocket::fairing::AdHoc; use std::{ collections::HashSet, diff --git a/nym-api/src/nym_contract_cache/cache/refresher.rs b/nym-api/src/nym_contract_cache/cache/refresher.rs index 61524be7aa..8f1bd1df4a 100644 --- a/nym-api/src/nym_contract_cache/cache/refresher.rs +++ b/nym-api/src/nym_contract_cache/cache/refresher.rs @@ -2,7 +2,7 @@ use super::NymContractCache; use crate::nyxd::Client; use crate::support::caching::CacheNotification; use anyhow::Result; -use mixnet_contract_common::{MixId, MixNodeDetails, RewardedSetNodeStatus}; +use nym_mixnet_contract_common::{MixId, MixNodeDetails, RewardedSetNodeStatus}; use std::{collections::HashMap, sync::atomic::Ordering, time::Duration}; use task::TaskClient; use tokio::sync::watch; diff --git a/nym-api/src/nym_contract_cache/routes.rs b/nym-api/src/nym_contract_cache/routes.rs index d0b7ffbd13..d649fc46a4 100644 --- a/nym-api/src/nym_contract_cache/routes.rs +++ b/nym-api/src/nym_contract_cache/routes.rs @@ -8,10 +8,10 @@ use crate::{ }, nym_contract_cache::cache::NymContractCache, }; -use mixnet_contract_common::{ +use nym_api_requests::models::MixNodeBondAnnotated; +use nym_mixnet_contract_common::{ mixnode::MixNodeDetails, reward_params::RewardingParams, GatewayBond, Interval, MixId, }; -use nym_api_requests::models::MixNodeBondAnnotated; use rocket::{serde::json::Json, State}; use rocket_okapi::openapi; diff --git a/nym-api/src/support/nyxd/mod.rs b/nym-api/src/support/nyxd/mod.rs index ad5b880f4d..c69b361c52 100644 --- a/nym-api/src/support/nyxd/mod.rs +++ b/nym-api/src/support/nyxd/mod.rs @@ -14,16 +14,17 @@ use coconut_dkg_common::{ verification_key::{ContractVKShare, VerificationKeyShare}, }; use config::defaults::{ChainDetails, NymNetworkDetails, DEFAULT_NYM_API_PORT}; -use contracts_common::dealings::ContractSafeBytes; use cw3::ProposalResponse; use cw4::MemberResponse; -use mixnet_contract_common::families::{Family, FamilyHead}; -use mixnet_contract_common::mixnode::MixNodeDetails; -use mixnet_contract_common::reward_params::RewardingParams; -use mixnet_contract_common::{ +use nym_contracts_common::dealings::ContractSafeBytes; +use nym_mixnet_contract_common::families::{Family, FamilyHead}; +use nym_mixnet_contract_common::mixnode::MixNodeDetails; +use nym_mixnet_contract_common::reward_params::RewardingParams; +use nym_mixnet_contract_common::{ CurrentIntervalResponse, ExecuteMsg, GatewayBond, IdentityKey, LayerAssignment, MixId, RewardedSetNodeStatus, }; +use nym_vesting_contract_common::AccountVestingCoins; use std::sync::Arc; use tokio::sync::RwLock; use validator_client::nyxd::error::NyxdError; @@ -41,7 +42,6 @@ use validator_client::nyxd::{ AccountId, Coin, SigningNyxdClient, TendermintTime, VestingQueryClient, }; use validator_client::ValidatorClientError; -use vesting_contract_common::AccountVestingCoins; pub(crate) struct Client(pub(crate) Arc>>); diff --git a/nym-api/src/support/storage/manager.rs b/nym-api/src/support/storage/manager.rs index 252e63e5f6..f3e4d6e011 100644 --- a/nym-api/src/support/storage/manager.rs +++ b/nym-api/src/support/storage/manager.rs @@ -6,7 +6,7 @@ use crate::node_status_api::utils::{ActiveGatewayStatuses, ActiveMixnodeStatuses use crate::support::storage::models::{ ActiveGateway, ActiveMixnode, NodeStatus, RewardingReport, TestingRoute, }; -use mixnet_contract_common::{EpochId, IdentityKey, MixId}; +use nym_mixnet_contract_common::{EpochId, IdentityKey, MixId}; use std::convert::TryFrom; #[derive(Clone)] diff --git a/nym-api/src/support/storage/mod.rs b/nym-api/src/support/storage/mod.rs index d7bc6fd233..ce80251e3d 100644 --- a/nym-api/src/support/storage/mod.rs +++ b/nym-api/src/support/storage/mod.rs @@ -10,7 +10,7 @@ use crate::node_status_api::models::{ use crate::node_status_api::{ONE_DAY, ONE_HOUR}; use crate::storage::manager::StorageManager; use crate::storage::models::{NodeStatus, RewardingReport, TestingRoute}; -use mixnet_contract_common::{EpochId, MixId}; +use nym_mixnet_contract_common::{EpochId, MixId}; use rocket::fairing::AdHoc; use sqlx::ConnectOptions; use std::path::PathBuf; diff --git a/nym-api/src/support/storage/models.rs b/nym-api/src/support/storage/models.rs index 00fd0a8953..607629a46c 100644 --- a/nym-api/src/support/storage/models.rs +++ b/nym-api/src/support/storage/models.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; // Internally used struct to catch results from the database to calculate uptimes for given mixnode/gateway pub(crate) struct NodeStatus { diff --git a/nym-connect-android/src-tauri/Cargo.lock b/nym-connect-android/src-tauri/Cargo.lock index 444b47e34f..a7117c48e4 100644 --- a/nym-connect-android/src-tauri/Cargo.lock +++ b/nym-connect-android/src-tauri/Cargo.lock @@ -633,7 +633,6 @@ dependencies = [ "async-trait", "client-connections", "config", - "crypto", "dashmap", "dirs", "futures", @@ -643,8 +642,9 @@ dependencies = [ "humantime-serde", "log", "nonexhaustive-delayqueue", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -718,10 +718,10 @@ dependencies = [ name = "coconut-dkg-common" version = "0.1.0" dependencies = [ - "contracts-common", "cosmwasm-std", "cw-utils", "multisig-contract-common", + "nym-contracts-common", "schemars", "serde", ] @@ -819,17 +819,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" -[[package]] -name = "contracts-common" -version = "0.1.0" -dependencies = [ - "bs58", - "cosmwasm-std", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "convert_case" version = "0.4.0" @@ -1014,8 +1003,8 @@ dependencies = [ "bls12_381 0.5.0", "coconut-interface", "cosmrs", - "crypto", "nym-api-requests", + "nym-crypto", "thiserror", "validator-client", ] @@ -1055,28 +1044,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto" -version = "0.1.0" -dependencies = [ - "aes 0.8.2", - "blake3", - "bs58", - "cipher 0.4.3", - "ctr 0.9.2", - "digest 0.10.6", - "ed25519-dalek", - "generic-array 0.14.6", - "hkdf 0.12.3", - "hmac 0.12.1", - "nymsphinx-types", - "pemstore", - "rand 0.7.3", - "subtle-encoding", - "thiserror", - "x25519-dalek", -] - [[package]] name = "crypto-bigint" version = "0.3.2" @@ -1488,7 +1455,7 @@ dependencies = [ "ff 0.11.1", "group 0.11.0", "lazy_static", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -2002,15 +1969,15 @@ dependencies = [ "coconut-interface", "credential-storage", "credentials", - "crypto", "futures", "gateway-requests", "getrandom 0.2.8", "log", "mobile-storage", "network-defaults", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "task", @@ -2034,11 +2001,11 @@ dependencies = [ "bs58", "coconut-interface", "credentials", - "crypto", "futures", "log", + "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -3355,23 +3322,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "mixnet-contract-common" -version = "0.1.0" -dependencies = [ - "bs58", - "contracts-common", - "cosmwasm-std", - "humantime-serde", - "log", - "schemars", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "time 0.3.17", -] - [[package]] name = "mobile-storage" version = "0.1.0" @@ -3599,7 +3549,7 @@ dependencies = [ "cosmrs", "cosmwasm-std", "getset", - "mixnet-contract-common", + "nym-mixnet-contract-common", "schemars", "serde", ] @@ -3613,8 +3563,6 @@ dependencies = [ "chrono", "client-core", "config", - "contracts-common", - "crypto", "dirs", "eyre", "fern", @@ -3624,6 +3572,8 @@ dependencies = [ "log", "logging", "nym-api-requests", + "nym-contracts-common", + "nym-crypto", "nym-socks5-client", "pretty_env_logger", "rand 0.8.5", @@ -3646,6 +3596,63 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "nym-contracts-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-crypto" +version = "0.1.0" +dependencies = [ + "aes 0.8.2", + "blake3", + "bs58", + "cipher 0.4.3", + "ctr 0.9.2", + "digest 0.10.6", + "ed25519-dalek", + "generic-array 0.14.6", + "hkdf 0.12.3", + "hmac 0.12.1", + "nym-pemstore", + "nymsphinx-types", + "rand 0.7.3", + "subtle-encoding", + "thiserror", + "x25519-dalek", +] + +[[package]] +name = "nym-mixnet-contract-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "humantime-serde", + "log", + "nym-contracts-common", + "schemars", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "time 0.3.17", +] + +[[package]] +name = "nym-pemstore" +version = "0.1.0" +dependencies = [ + "pem", +] + [[package]] name = "nym-socks5-client" version = "1.1.8" @@ -3658,7 +3665,6 @@ dependencies = [ "completions", "config", "credentials", - "crypto", "dirs", "futures", "gateway-client", @@ -3668,9 +3674,10 @@ dependencies = [ "logging", "mobile-storage", "network-defaults", + "nym-crypto", + "nym-pemstore", "nymsphinx", "ordered-buffer", - "pemstore", "pin-project", "pretty_env_logger", "proxy-helpers", @@ -3689,6 +3696,32 @@ dependencies = [ "version-checker", ] +[[package]] +name = "nym-vesting-contract" +version = "1.1.3" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", + "schemars", + "serde", + "thiserror", + "vergen 5.1.17", +] + +[[package]] +name = "nym-vesting-contract-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "nym-contracts-common", + "nym-mixnet-contract-common", + "schemars", + "serde", +] + [[package]] name = "nymcoconut" version = "0.5.0" @@ -3701,7 +3734,7 @@ dependencies = [ "getrandom 0.2.8", "group 0.11.0", "itertools", - "pemstore", + "nym-pemstore", "rand 0.8.5", "serde", "serde_derive", @@ -3713,7 +3746,7 @@ dependencies = [ name = "nymsphinx" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-acknowledgements", "nymsphinx-addressing", "nymsphinx-anonymous-replies", @@ -3734,11 +3767,11 @@ dependencies = [ name = "nymsphinx-acknowledgements" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", + "nym-pemstore", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", - "pemstore", "rand 0.7.3", "thiserror", "topology", @@ -3748,7 +3781,7 @@ dependencies = [ name = "nymsphinx-addressing" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-types", "serde", "thiserror", @@ -3759,7 +3792,7 @@ name = "nymsphinx-anonymous-replies" version = "0.1.0" dependencies = [ "bs58", - "crypto", + "nym-crypto", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", @@ -3786,7 +3819,7 @@ dependencies = [ name = "nymsphinx-cover" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-acknowledgements", "nymsphinx-addressing", "nymsphinx-chunking", @@ -3822,7 +3855,7 @@ dependencies = [ name = "nymsphinx-params" version = "0.1.0" dependencies = [ - "crypto", + "nym-crypto", "nymsphinx-types", "thiserror", ] @@ -4127,13 +4160,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pemstore" -version = "0.1.0" -dependencies = [ - "pem", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -6518,9 +6544,9 @@ name = "topology" version = "0.1.0" dependencies = [ "bs58", - "crypto", "log", - "mixnet-contract-common", + "nym-crypto", + "nym-mixnet-contract-common", "nymsphinx-addressing", "nymsphinx-types", "rand 0.7.3", @@ -6780,7 +6806,6 @@ dependencies = [ "coconut-interface", "colored 2.0.0", "config", - "contracts-common", "cosmrs", "cosmwasm-std", "cw3", @@ -6791,10 +6816,13 @@ dependencies = [ "group-contract-common", "itertools", "log", - "mixnet-contract-common", "multisig-contract-common", "network-defaults", "nym-api-requests", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract", + "nym-vesting-contract-common", "prost", "reqwest", "serde", @@ -6803,8 +6831,6 @@ dependencies = [ "thiserror", "tokio", "url", - "vesting-contract", - "vesting-contract-common", ] [[package]] @@ -6872,32 +6898,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vesting-contract" -version = "1.1.3" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "cw-storage-plus", - "mixnet-contract-common", - "schemars", - "serde", - "thiserror", - "vergen 5.1.17", - "vesting-contract-common", -] - -[[package]] -name = "vesting-contract-common" -version = "0.1.0" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "mixnet-contract-common", - "schemars", - "serde", -] - [[package]] name = "vte" version = "0.10.1" diff --git a/nym-connect-android/src-tauri/Cargo.toml b/nym-connect-android/src-tauri/Cargo.toml index e474b17dad..c175940b5e 100644 --- a/nym-connect-android/src-tauri/Cargo.toml +++ b/nym-connect-android/src-tauri/Cargo.toml @@ -48,9 +48,9 @@ yaml-rust = "0.4" client-core = { path = "../../clients/client-core" } nym-api-requests = { path = "../../nym-api/nym-api-requests" } -contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common"} +nym-contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common"} config-common = { path = "../../common/config", package = "config" } -crypto = { path = "../../common/crypto" } +nym-crypto = { path = "../../common/crypto" } logging = { path = "../../common/logging"} nym-socks5-client = { path = "../../clients/socks5", features = ["mobile"], default-features = false } task = { path = "../../common/task" } diff --git a/nym-connect-android/src-tauri/src/config/mod.rs b/nym-connect-android/src-tauri/src/config/mod.rs index 4e8f2751f1..9e22ea806d 100644 --- a/nym-connect-android/src-tauri/src/config/mod.rs +++ b/nym-connect-android/src-tauri/src/config/mod.rs @@ -4,7 +4,7 @@ use crate::{ }; use client_core::{client::key_manager::KeyManager, config::Config as BaseConfig}; use config_common::NymConfig; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nym_socks5::client::config::Config as Socks5Config; use std::path::PathBuf; use std::sync::Arc; diff --git a/nym-connect-android/src-tauri/src/operations/directory/mod.rs b/nym-connect-android/src-tauri/src/operations/directory/mod.rs index 66070a3b00..0e58035274 100644 --- a/nym-connect-android/src-tauri/src/operations/directory/mod.rs +++ b/nym-connect-android/src-tauri/src/operations/directory/mod.rs @@ -4,8 +4,8 @@ use crate::error::Result; use crate::models::{ DirectoryService, DirectoryServiceProvider, HarbourMasterService, PagedResult, }; -use contracts_common::types::Percent; use nym_api_requests::models::GatewayBondAnnotated; +use nym_contracts_common::types::Percent; static SERVICE_PROVIDER_WELLKNOWN_URL: &str = "https://nymtech.net/.wellknown/connect/service-providers.json"; diff --git a/nym-connect-android/src-tauri/src/operations/export.rs b/nym-connect-android/src-tauri/src/operations/export.rs index 93c2e81bc8..1ebff1a35a 100644 --- a/nym-connect-android/src-tauri/src/operations/export.rs +++ b/nym-connect-android/src-tauri/src/operations/export.rs @@ -7,7 +7,7 @@ use crate::{ }; use client_core::client::key_manager::KeyManager; use client_core::config::persistence::key_pathfinder::ClientKeyPathfinder; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; pub async fn get_identity_key( state: &tauri::State<'_, Arc>>, diff --git a/nym-connect/src-tauri/Cargo.toml b/nym-connect/src-tauri/Cargo.toml index d80662fd18..11dd7db775 100644 --- a/nym-connect/src-tauri/Cargo.toml +++ b/nym-connect/src-tauri/Cargo.toml @@ -46,9 +46,9 @@ yaml-rust = "0.4" client-core = { path = "../../clients/client-core" } nym-api-requests = { path = "../../nym-api/nym-api-requests" } -contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common"} +nym-contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common"} config-common = { path = "../../common/config", package = "config" } -crypto = { path = "../../common/crypto" } +nym-crypto = { path = "../../common/crypto" } logging = { path = "../../common/logging"} nym-socks5-client = { path = "../../clients/socks5" } task = { path = "../../common/task" } diff --git a/nym-connect/src-tauri/src/config/mod.rs b/nym-connect/src-tauri/src/config/mod.rs index 38073d0d72..4305427505 100644 --- a/nym-connect/src-tauri/src/config/mod.rs +++ b/nym-connect/src-tauri/src/config/mod.rs @@ -4,7 +4,7 @@ use crate::{ }; use client_core::config::Config as BaseConfig; use config_common::NymConfig; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nym_socks5::client::config::Config as Socks5Config; use std::path::PathBuf; use std::sync::Arc; diff --git a/nym-connect/src-tauri/src/operations/directory/mod.rs b/nym-connect/src-tauri/src/operations/directory/mod.rs index 66070a3b00..0e58035274 100644 --- a/nym-connect/src-tauri/src/operations/directory/mod.rs +++ b/nym-connect/src-tauri/src/operations/directory/mod.rs @@ -4,8 +4,8 @@ use crate::error::Result; use crate::models::{ DirectoryService, DirectoryServiceProvider, HarbourMasterService, PagedResult, }; -use contracts_common::types::Percent; use nym_api_requests::models::GatewayBondAnnotated; +use nym_contracts_common::types::Percent; static SERVICE_PROVIDER_WELLKNOWN_URL: &str = "https://nymtech.net/.wellknown/connect/service-providers.json"; diff --git a/nym-connect/src-tauri/src/operations/export.rs b/nym-connect/src-tauri/src/operations/export.rs index 93c2e81bc8..1ebff1a35a 100644 --- a/nym-connect/src-tauri/src/operations/export.rs +++ b/nym-connect/src-tauri/src/operations/export.rs @@ -7,7 +7,7 @@ use crate::{ }; use client_core::client::key_manager::KeyManager; use client_core::config::persistence::key_pathfinder::ClientKeyPathfinder; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; pub async fn get_identity_key( state: &tauri::State<'_, Arc>>, diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 2efa31c900..c44bb0136b 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -593,10 +593,10 @@ dependencies = [ name = "coconut-dkg-common" version = "0.1.0" dependencies = [ - "contracts-common", "cosmwasm-std", "cw-utils", "multisig-contract-common", + "nym-contracts-common", "schemars", "serde", ] @@ -679,17 +679,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" -[[package]] -name = "contracts-common" -version = "0.1.0" -dependencies = [ - "bs58", - "cosmwasm-std", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "convert_case" version = "0.4.0" @@ -1210,7 +1199,7 @@ dependencies = [ "ff", "group", "lazy_static", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -2729,24 +2718,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "mixnet-contract-common" -version = "0.1.0" -dependencies = [ - "bs58", - "contracts-common", - "cosmwasm-std", - "humantime-serde", - "log", - "schemars", - "serde", - "serde_json", - "serde_repr", - "thiserror", - "time 0.3.17", - "ts-rs", -] - [[package]] name = "multisig-contract-common" version = "0.1.0" @@ -2932,11 +2903,47 @@ dependencies = [ "cosmrs", "cosmwasm-std", "getset", - "mixnet-contract-common", + "nym-mixnet-contract-common", "schemars", "serde", ] +[[package]] +name = "nym-contracts-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-mixnet-contract-common" +version = "0.1.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "humantime-serde", + "log", + "nym-contracts-common", + "schemars", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "time 0.3.7", + "ts-rs", +] + +[[package]] +name = "nym-pemstore" +version = "0.1.0" +dependencies = [ + "pem", +] + [[package]] name = "nym-types" version = "1.0.0" @@ -2948,7 +2955,9 @@ dependencies = [ "eyre", "itertools", "log", - "mixnet-contract-common", + "nym-mixnet-contract-common", + "nym-vesting-contract", + "nym-vesting-contract-common", "reqwest", "schemars", "serde", @@ -2958,8 +2967,32 @@ dependencies = [ "ts-rs", "url", "validator-client", - "vesting-contract", - "vesting-contract-common", +] + +[[package]] +name = "nym-vesting-contract" +version = "1.1.3" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", + "schemars", + "serde", + "thiserror", + "vergen", +] + +[[package]] +name = "nym-vesting-contract-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "nym-contracts-common", + "nym-mixnet-contract-common", + "schemars", + "serde", ] [[package]] @@ -2986,16 +3019,16 @@ dependencies = [ "cosmrs", "cosmwasm-std", "hex-literal", - "mixnet-contract-common", "network-defaults", + "nym-mixnet-contract-common", "nym-types", + "nym-vesting-contract", + "nym-vesting-contract-common", "serde", "serde_json", "strum", "ts-rs", "validator-client", - "vesting-contract", - "vesting-contract-common", ] [[package]] @@ -3021,8 +3054,10 @@ dependencies = [ "itertools", "k256", "log", - "mixnet-contract-common", + "nym-mixnet-contract-common", "nym-types", + "nym-vesting-contract", + "nym-vesting-contract-common", "nym-wallet-types", "once_cell", "pretty_env_logger", @@ -3044,8 +3079,6 @@ dependencies = [ "ts-rs", "url", "validator-client", - "vesting-contract", - "vesting-contract-common", "zeroize", ] @@ -3061,7 +3094,7 @@ dependencies = [ "getrandom 0.2.8", "group", "itertools", - "pemstore", + "nym-pemstore", "rand 0.8.5", "serde", "serde_derive", @@ -3325,13 +3358,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pemstore" -version = "0.1.0" -dependencies = [ - "pem", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -5495,7 +5521,6 @@ dependencies = [ "coconut-interface", "colored 2.0.0", "config", - "contracts-common", "cosmrs", "cosmwasm-std", "cw3", @@ -5506,10 +5531,13 @@ dependencies = [ "group-contract-common", "itertools", "log", - "mixnet-contract-common", "multisig-contract-common", "network-defaults", "nym-api-requests", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract", + "nym-vesting-contract-common", "prost", "reqwest", "serde", @@ -5518,8 +5546,6 @@ dependencies = [ "thiserror", "tokio", "url", - "vesting-contract", - "vesting-contract-common", ] [[package]] @@ -5569,32 +5595,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vesting-contract" -version = "1.1.3" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "cw-storage-plus", - "mixnet-contract-common", - "schemars", - "serde", - "thiserror", - "vergen", - "vesting-contract-common", -] - -[[package]] -name = "vesting-contract-common" -version = "0.1.0" -dependencies = [ - "contracts-common", - "cosmwasm-std", - "mixnet-contract-common", - "schemars", - "serde", -] - [[package]] name = "walkdir" version = "2.3.2" diff --git a/nym-wallet/nym-wallet-types/Cargo.toml b/nym-wallet/nym-wallet-types/Cargo.toml index d2f0bde28a..399de11c26 100644 --- a/nym-wallet/nym-wallet-types/Cargo.toml +++ b/nym-wallet/nym-wallet-types/Cargo.toml @@ -16,19 +16,19 @@ cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegr config = { path = "../../common/config" } network-defaults = { path = "../../common/network-defaults" } -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } +nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } validator-client = { path = "../../common/client-libs/validator-client", features = [ "nyxd-client", ] } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } +nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } # Used for Type conversion, can be extracted but its a lot of work -vesting-contract = { path = "../../contracts/vesting" } +nym-vesting-contract = { path = "../../contracts/vesting" } nym-types = { path = "../../common/types" } [features] default = [] -generate-ts = ["mixnet-contract-common/generate-ts", "nym-types/generate-ts"] +generate-ts = ["nym-mixnet-contract-common/generate-ts", "nym-types/generate-ts"] diff --git a/nym-wallet/nym-wallet-types/src/admin.rs b/nym-wallet/nym-wallet-types/src/admin.rs index 183ecb7a8b..23fc67cecb 100644 --- a/nym-wallet/nym-wallet-types/src/admin.rs +++ b/nym-wallet/nym-wallet-types/src/admin.rs @@ -1,7 +1,7 @@ // Copyright 2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::ContractStateParams; +use nym_mixnet_contract_common::ContractStateParams; use nym_types::currency::{DecCoin, RegisteredCoins}; use nym_types::error::TypesError; use serde::{Deserialize, Serialize}; diff --git a/nym-wallet/nym-wallet-types/src/interval.rs b/nym-wallet/nym-wallet-types/src/interval.rs index c4937b4922..f9772c9082 100644 --- a/nym-wallet/nym-wallet-types/src/interval.rs +++ b/nym-wallet/nym-wallet-types/src/interval.rs @@ -1,7 +1,7 @@ // Copyright 2021-2022 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use mixnet_contract_common::{EpochId, Interval as ContractInterval, IntervalId}; +use nym_mixnet_contract_common::{EpochId, Interval as ContractInterval, IntervalId}; use serde::{Deserialize, Serialize}; // TODO: ask @MS why we can't just use ContractInterval directly diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 1be9d6eb28..d34c014306 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -57,12 +57,12 @@ cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegr validator-client = { path = "../../common/client-libs/validator-client", features = [ "nyxd-client", ] } -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" } +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" } coconut-interface = { path = "../../common/coconut-interface" } # Used for Type conversion, can be extracted but its a lot of work -vesting-contract = { path = "../../contracts/vesting" } +nym-vesting-contract = { path = "../../contracts/vesting" } nym-types = { path = "../../common/types" } nym-wallet-types = { path = "../nym-wallet-types" } diff --git a/nym-wallet/src-tauri/src/main.rs b/nym-wallet/src-tauri/src/main.rs index cc82f9f7df..33b8217c58 100644 --- a/nym-wallet/src-tauri/src/main.rs +++ b/nym-wallet/src-tauri/src/main.rs @@ -5,7 +5,7 @@ use tauri::{Manager, Menu}; -use mixnet_contract_common::{Gateway, MixNode}; +use nym_mixnet_contract_common::{Gateway, MixNode}; use crate::menu::AddDefaultSubmenus; use crate::operations::help; diff --git a/nym-wallet/src-tauri/src/operations/mixnet/admin.rs b/nym-wallet/src-tauri/src/operations/mixnet/admin.rs index 3633c3ac5d..d25e9ff8e6 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/admin.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/admin.rs @@ -3,7 +3,7 @@ use crate::error::BackendError; use crate::state::WalletState; -use mixnet_contract_common::ContractStateParams; +use nym_mixnet_contract_common::ContractStateParams; use nym_types::transaction::TransactionExecuteResult; use nym_wallet_types::admin::TauriContractStateParams; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; diff --git a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs index 66276462e7..216dd12841 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs @@ -4,7 +4,7 @@ use crate::error::BackendError; use crate::state::WalletState; use crate::{nyxd_client, Gateway, MixNode}; -use mixnet_contract_common::{MixId, MixNodeConfigUpdate}; +use nym_mixnet_contract_common::{MixId, MixNodeConfigUpdate}; use nym_types::currency::DecCoin; use nym_types::gateway::GatewayBond; use nym_types::mixnode::{MixNodeCostParams, MixNodeDetails}; diff --git a/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs b/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs index cf26c1f527..6d54ee878d 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs @@ -4,7 +4,7 @@ use crate::error::BackendError; use crate::state::WalletState; use crate::vesting::delegate::vesting_undelegate_from_mixnode; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use nym_types::currency::DecCoin; use nym_types::delegation::{Delegation, DelegationWithEverything, DelegationsSummaryResponse}; use nym_types::deprecated::{ diff --git a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs index 0a6fd3ae7f..18a680b985 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs @@ -1,7 +1,7 @@ use crate::error::BackendError; use crate::state::WalletState; use crate::vesting::rewards::vesting_claim_delegator_reward; -use mixnet_contract_common::{MixId, RewardingParams}; +use nym_mixnet_contract_common::{MixId, RewardingParams}; use nym_types::transaction::TransactionExecuteResult; use validator_client::nyxd::traits::{MixnetQueryClient, MixnetSigningClient}; use validator_client::nyxd::Fee; diff --git a/nym-wallet/src-tauri/src/operations/nym_api/status.rs b/nym-wallet/src-tauri/src/operations/nym_api/status.rs index 873a1fa0a4..257fcd798f 100644 --- a/nym-wallet/src-tauri/src/operations/nym_api/status.rs +++ b/nym-wallet/src-tauri/src/operations/nym_api/status.rs @@ -4,7 +4,9 @@ use crate::api_client; use crate::error::BackendError; use crate::state::WalletState; -use mixnet_contract_common::{reward_params::Performance, Coin, IdentityKeyRef, MixId, Percent}; +use nym_mixnet_contract_common::{ + reward_params::Performance, Coin, IdentityKeyRef, MixId, Percent, +}; use validator_client::models::{ ComputeRewardEstParam, GatewayCoreStatusResponse, GatewayStatusReportResponse, InclusionProbabilityResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse, diff --git a/nym-wallet/src-tauri/src/operations/simulate/admin.rs b/nym-wallet/src-tauri/src/operations/simulate/admin.rs index 5ca826bb90..f47b44e454 100644 --- a/nym-wallet/src-tauri/src/operations/simulate/admin.rs +++ b/nym-wallet/src-tauri/src/operations/simulate/admin.rs @@ -4,7 +4,7 @@ use crate::error::BackendError; use crate::operations::simulate::FeeDetails; use crate::WalletState; -use mixnet_contract_common::{ContractStateParams, ExecuteMsg}; +use nym_mixnet_contract_common::{ContractStateParams, ExecuteMsg}; use nym_wallet_types::admin::TauriContractStateParams; #[tauri::command] diff --git a/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs b/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs index 7adc677c74..a971fea215 100644 --- a/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs +++ b/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs @@ -4,8 +4,8 @@ use crate::error::BackendError; use crate::operations::simulate::FeeDetails; use crate::WalletState; -use mixnet_contract_common::MixNodeConfigUpdate; -use mixnet_contract_common::{ExecuteMsg, Gateway, MixId, MixNode}; +use nym_mixnet_contract_common::MixNodeConfigUpdate; +use nym_mixnet_contract_common::{ExecuteMsg, Gateway, MixId, MixNode}; use nym_types::currency::DecCoin; use nym_types::mixnode::MixNodeCostParams; diff --git a/nym-wallet/src-tauri/src/operations/simulate/vesting.rs b/nym-wallet/src-tauri/src/operations/simulate/vesting.rs index d34c2d6fcf..b0616bb0ef 100644 --- a/nym-wallet/src-tauri/src/operations/simulate/vesting.rs +++ b/nym-wallet/src-tauri/src/operations/simulate/vesting.rs @@ -4,11 +4,11 @@ use crate::error::BackendError; use crate::operations::simulate::FeeDetails; use crate::WalletState; -use mixnet_contract_common::MixNodeConfigUpdate; -use mixnet_contract_common::{Gateway, MixId, MixNode}; +use nym_mixnet_contract_common::MixNodeConfigUpdate; +use nym_mixnet_contract_common::{Gateway, MixId, MixNode}; use nym_types::currency::DecCoin; use nym_types::mixnode::MixNodeCostParams; -use vesting_contract_common::ExecuteMsg; +use nym_vesting_contract_common::ExecuteMsg; async fn simulate_vesting_operation( msg: ExecuteMsg, diff --git a/nym-wallet/src-tauri/src/operations/vesting/bond.rs b/nym-wallet/src-tauri/src/operations/vesting/bond.rs index cb36653b47..c884be5538 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/bond.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/bond.rs @@ -2,7 +2,7 @@ use crate::error::BackendError; use crate::nyxd_client; use crate::state::WalletState; use crate::{Gateway, MixNode}; -use mixnet_contract_common::MixNodeConfigUpdate; +use nym_mixnet_contract_common::MixNodeConfigUpdate; use nym_types::currency::DecCoin; use nym_types::mixnode::MixNodeCostParams; diff --git a/nym-wallet/src-tauri/src/operations/vesting/delegate.rs b/nym-wallet/src-tauri/src/operations/vesting/delegate.rs index 66498eb9ad..53e3822e67 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/delegate.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/delegate.rs @@ -3,7 +3,7 @@ use crate::error::BackendError; use crate::state::WalletState; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use nym_types::currency::DecCoin; use nym_types::transaction::TransactionExecuteResult; use validator_client::nyxd::{Fee, VestingSigningClient}; diff --git a/nym-wallet/src-tauri/src/operations/vesting/queries.rs b/nym-wallet/src-tauri/src/operations/vesting/queries.rs index 5fe2d2dba7..cf664652ca 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/queries.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/queries.rs @@ -8,8 +8,8 @@ use cosmwasm_std::Timestamp; use nym_types::currency::DecCoin; use nym_types::vesting::VestingAccountInfo; use nym_types::vesting::{OriginalVestingResponse, PledgeData}; +use nym_vesting_contract_common::Period; use validator_client::nyxd::VestingQueryClient; -use vesting_contract_common::Period; #[tauri::command] pub async fn locked_coins( diff --git a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs index 32fc67257a..e3f42ba7a7 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs @@ -3,7 +3,7 @@ use crate::error::BackendError; use crate::state::WalletState; -use mixnet_contract_common::MixId; +use nym_mixnet_contract_common::MixId; use nym_types::transaction::TransactionExecuteResult; use validator_client::nyxd::Fee; diff --git a/nym-wallet/src-tauri/src/utils.rs b/nym-wallet/src-tauri/src/utils.rs index 355a6cb6cd..fee3a1b727 100644 --- a/nym-wallet/src-tauri/src/utils.rs +++ b/nym-wallet/src-tauri/src/utils.rs @@ -5,7 +5,7 @@ use crate::error::BackendError; use crate::nyxd_client; use crate::state::WalletState; use cosmwasm_std::Decimal; -use mixnet_contract_common::{IdentityKey, MixId, Percent}; +use nym_mixnet_contract_common::{IdentityKey, MixId, Percent}; use nym_types::currency::DecCoin; use nym_types::mixnode::MixNodeCostParams; use nym_wallet_types::app::AppEnv; diff --git a/sdk/rust/nym-sdk/Cargo.toml b/sdk/rust/nym-sdk/Cargo.toml index 97887d188e..791828de4a 100644 --- a/sdk/rust/nym-sdk/Cargo.toml +++ b/sdk/rust/nym-sdk/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] client-connections = { path = "../../../common/client-connections" } client-core = { path = "../../../clients/client-core", features = ["fs-surb-storage"]} -crypto = { path = "../../../common/crypto" } +nym-crypto = { path = "../../../common/crypto" } gateway-client = { path = "../../../common/client-libs/gateway-client" } gateway-requests = { path = "../../../gateway/gateway-requests" } network-defaults = { path = "../../../common/network-defaults" } diff --git a/sdk/rust/nym-sdk/src/error.rs b/sdk/rust/nym-sdk/src/error.rs index fb1ce1c8ff..75c555c947 100644 --- a/sdk/rust/nym-sdk/src/error.rs +++ b/sdk/rust/nym-sdk/src/error.rs @@ -10,7 +10,7 @@ pub enum Error { #[error("toml deserialization error: {0}")] TomlDeserializationError(#[from] toml::de::Error), #[error("Ed25519 error: {0}")] - Ed25519RecoveryError(#[from] crypto::asymmetric::identity::Ed25519RecoveryError), + Ed25519RecoveryError(#[from] nym_crypto::asymmetric::identity::Ed25519RecoveryError), #[error(transparent)] ClientCoreError(#[from] client_core::error::ClientCoreError), diff --git a/sdk/rust/nym-sdk/src/mixnet/client.rs b/sdk/rust/nym-sdk/src/mixnet/client.rs index 9439905489..0b7c633ebc 100644 --- a/sdk/rust/nym-sdk/src/mixnet/client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/client.rs @@ -13,7 +13,7 @@ use client_core::{ }, config::{persistence::key_pathfinder::ClientKeyPathfinder, GatewayEndpointConfig}, }; -use crypto::asymmetric::identity; +use nym_crypto::asymmetric::identity; use nymsphinx::{ addressing::clients::{ClientIdentity, Recipient}, receiver::ReconstructedMessage, diff --git a/sdk/rust/nym-sdk/src/mixnet/keys.rs b/sdk/rust/nym-sdk/src/mixnet/keys.rs index 5d1a1d8f98..74593410eb 100644 --- a/sdk/rust/nym-sdk/src/mixnet/keys.rs +++ b/sdk/rust/nym-sdk/src/mixnet/keys.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use client_core::client::key_manager::KeyManager; -use crypto::asymmetric::{encryption, identity}; use gateway_requests::registration::handshake::SharedKeys; +use nym_crypto::asymmetric::{encryption, identity}; use nymsphinx::acknowledgements::AckKey; /// The set of keys used by the client. Identity, encryption and ack keys are generated at creating diff --git a/tools/ts-rs-cli/Cargo.toml b/tools/ts-rs-cli/Cargo.toml index 9d03747efe..7b07fd9b4b 100644 --- a/tools/ts-rs-cli/Cargo.toml +++ b/tools/ts-rs-cli/Cargo.toml @@ -14,7 +14,7 @@ validator-client = { path = "../../common/client-libs/validator-client", feature "nyxd-client", "generate-ts" ] } nym-api-requests = { path = "../../nym-api/nym-api-requests", features = ["generate-ts"] } -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", features = [ "generate-ts" ] } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", features = [ "generate-ts" ] } +nym-mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", features = [ "generate-ts" ]} +nym-vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", features = [ "generate-ts" ] } nym-types = { path = "../../common/types", features = [ "generate-ts" ] } nym-wallet-types = { path = "../../nym-wallet/nym-wallet-types", features = [ "generate-ts" ] } diff --git a/tools/ts-rs-cli/src/main.rs b/tools/ts-rs-cli/src/main.rs index 762dd4b03f..9b6ea3f2c2 100644 --- a/tools/ts-rs-cli/src/main.rs +++ b/tools/ts-rs-cli/src/main.rs @@ -1,13 +1,13 @@ -use mixnet_contract_common::rewarding::RewardEstimate; -use mixnet_contract_common::{ - Interval as ContractInterval, IntervalRewardParams, IntervalRewardingParamsUpdate, MixNode, - MixNodeConfigUpdate, RewardedSetNodeStatus, RewardingParams, UnbondedMixnode, -}; use nym_api_requests::models::{ GatewayCoreStatusResponse, InclusionProbabilityResponse, MixnodeCoreStatusResponse, MixnodeStatus, MixnodeStatusResponse, RewardEstimationResponse, SelectionChance, StakeSaturationResponse, }; +use nym_mixnet_contract_common::rewarding::RewardEstimate; +use nym_mixnet_contract_common::{ + Interval as ContractInterval, IntervalRewardParams, IntervalRewardingParamsUpdate, MixNode, + MixNodeConfigUpdate, RewardedSetNodeStatus, RewardingParams, UnbondedMixnode, +}; use nym_types::account::{Account, AccountEntry, AccountWithMnemonic, Balance}; use nym_types::currency::{CurrencyDenom, DecCoin}; use nym_types::delegation::{ @@ -25,6 +25,7 @@ use nym_types::transaction::{ RpcTransactionResponse, SendTxResult, TransactionDetails, TransactionExecuteResult, }; use nym_types::vesting::{OriginalVestingResponse, PledgeData, VestingAccountInfo, VestingPeriod}; +use nym_vesting_contract_common::Period; use nym_wallet_types::admin::TauriContractStateParams; use nym_wallet_types::app::AppEnv; use nym_wallet_types::interval::Interval; @@ -32,7 +33,6 @@ use nym_wallet_types::network::Network; use nym_wallet_types::network_config::{Validator, ValidatorUrl, ValidatorUrls}; use std::path::Path; use ts_rs::TS; -use vesting_contract_common::Period; use walkdir::WalkDir; macro_rules! do_export {