diff --git a/Cargo.lock b/Cargo.lock index bce501fd..f6f2569f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1132,6 +1132,25 @@ dependencies = [ "libc", ] +[[package]] +name = "cctl-rs" +version = "0.1.0" +source = "git+https://github.com/cspr-rad/cctl-rs#da4400558ead366af9c075b5c02d16f30ddadcea" +dependencies = [ + "anyhow", + "backoff", + "casper-client", + "casper-types 3.0.0", + "clap", + "hex", + "nom", + "sd-notify", + "tempfile", + "tokio", + "tracing", + "tracing-subscriber", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -2710,6 +2729,7 @@ dependencies = [ "casper-client", "casper-hashing 2.0.0", "casper-types 3.0.0", + "cctl-rs", "chrono", "clap", "dotenvy", @@ -2773,6 +2793,7 @@ dependencies = [ "casper-event-toolkit", "casper-types 3.0.0", "casper-types 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cctl-rs", "chrono", "contract-utils", "dotenvy", @@ -4207,6 +4228,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +[[package]] +name = "sd-notify" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4646d6f919800cd25c50edb49438a1381e2cd4833c027e75e8897981c50b8b5e" + [[package]] name = "sec1" version = "0.7.3" diff --git a/Cargo.toml b/Cargo.toml index af3e6d16..cb11d407 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ license = "MIT OR Apache-2.0" opt-level = 3 [workspace.dependencies] +cctl-rs = { git = "https://github.com/cspr-rad/cctl-rs" } casper-client = "2.0" casper-types = "4.0" casper-client-types = { package = "casper-types", version = "3.0" } diff --git a/kairos-cli/Cargo.toml b/kairos-cli/Cargo.toml index db8d45de..4d224fcd 100644 --- a/kairos-cli/Cargo.toml +++ b/kairos-cli/Cargo.toml @@ -26,6 +26,7 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["std", "env-filter"] } casper-client.workspace = true casper-client-types = { workspace = true, features = ["std"] } # TODO: Change `std` -> `std-fs-io` in the future version. +cctl-rs.workspace = true clap = { version = "4", features = ["derive", "deprecated"] } chrono = { version = "0.4", optional = true } hex = "0.4" diff --git a/kairos-cli/src/commands/run_cctl.rs b/kairos-cli/src/commands/run_cctl.rs index b15a9c2b..d00bb42d 100644 --- a/kairos-cli/src/commands/run_cctl.rs +++ b/kairos-cli/src/commands/run_cctl.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use casper_client_types::{runtime_args, RuntimeArgs}; -use kairos_test_utils::cctl::{CCTLNetwork, DeployableContract}; +use cctl::{CCTLNetwork, DeployableContract}; use crate::error::CliError; @@ -19,7 +19,7 @@ pub fn run() -> Result { let chainspec_path = PathBuf::from(std::env::var("CCTL_CHAINSPEC").unwrap()); let config_path = PathBuf::from(std::env::var("CCTL_CONFIG").unwrap()); - let network = CCTLNetwork::run(None, Some(contract_to_deploy), Some(chainspec_path.as_path()), Some(config_path.as_path())) + let network = CCTLNetwork::run(None, Some(contract_to_deploy), Some(chainspec_path), Some(config_path)) .await .unwrap(); diff --git a/kairos-cli/tests/cli_tests.rs b/kairos-cli/tests/cli_tests.rs index 7b1408bc..66ccbbde 100644 --- a/kairos-cli/tests/cli_tests.rs +++ b/kairos-cli/tests/cli_tests.rs @@ -5,12 +5,10 @@ use std::path::PathBuf; use casper_client::types::DeployHash; use casper_client_hashing::Digest; +use cctl::{CCTLNetwork, DeployableContract}; +use kairos_test_utils::kairos::Kairos; #[cfg(feature = "database")] use kairos_test_utils::postgres::PostgresDB; -use kairos_test_utils::{ - cctl::{CCTLNetwork, DeployableContract}, - kairos::Kairos, -}; // Helper function to get the path to a fixture file fn fixture_path(relative_path: &str) -> PathBuf { diff --git a/kairos-server/Cargo.toml b/kairos-server/Cargo.toml index 474f8ac8..916f5ca3 100644 --- a/kairos-server/Cargo.toml +++ b/kairos-server/Cargo.toml @@ -56,3 +56,4 @@ proptest = "1" axum-test = "14" kairos-test-utils = { path = "../kairos-test-utils" } casper-client-types.workspace = true +cctl-rs.workspace = true diff --git a/kairos-server/tests/transactions.rs b/kairos-server/tests/transactions.rs index 7811ccfe..96b3ce51 100644 --- a/kairos-server/tests/transactions.rs +++ b/kairos-server/tests/transactions.rs @@ -15,6 +15,7 @@ use casper_client_types::{ crypto::{PublicKey, SecretKey}, AsymmetricType, ContractHash, }; +use cctl::CCTLNetwork; #[cfg(feature = "database")] use kairos_data::new as new_pool; use kairos_server::{ @@ -22,7 +23,6 @@ use kairos_server::{ routes::deposit::DepositPath, state::{BatchStateManager, ServerStateInner}, }; -use kairos_test_utils::cctl::CCTLNetwork; #[cfg(feature = "database")] use kairos_test_utils::postgres::PostgresDB;