diff --git a/Cargo.lock b/Cargo.lock index 34428d407..263e918ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -732,7 +732,7 @@ name = "cronos-bot" version = "0.1.3" dependencies = [ "anchor-client", - "cronos-sdk 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cronos-sdk", "dotenv", "postgres", "solana-account-decoder", @@ -749,7 +749,7 @@ version = "0.1.3" dependencies = [ "anchor-lang", "clap 3.1.2", - "cronos-sdk 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cronos-sdk", "serde", "serde_json", "solana-account-decoder", @@ -772,35 +772,12 @@ dependencies = [ "solana-program", ] -[[package]] -name = "cronos-program" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06a2670e6a851d5fb9d8002959cf17b51f2336b9ba094380f8e2d2392ce9fea" -dependencies = [ - "anchor-lang", - "solana-program", -] - -[[package]] -name = "cronos-sdk" -version = "0.1.3" -dependencies = [ - "anchor-client", - "cronos-program 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-client-helpers", - "solana-program", - "solana-sdk", -] - [[package]] name = "cronos-sdk" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46288c50255a5d9ae9550754b6e56827299c10f043d0a30d5c2d4b5598e26269" dependencies = [ "anchor-client", - "cronos-program 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cronos-program", "solana-client-helpers", "solana-program", "solana-sdk", diff --git a/bot/Cargo.toml b/bot/Cargo.toml index a2093c176..d52132d13 100644 --- a/bot/Cargo.toml +++ b/bot/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["solana", "cronos", "program"] [dependencies] anchor-client = "0.22.0" -cronos-sdk = "0.1.3" +cronos-sdk = { path = "../sdk", version = "0.1.3"} dotenv = "0.15.0" postgres = "0.19.2" solana-account-decoder = "1.9.9" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index bb57dad0e..b1183564d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["solana", "cronos", "cli"] [dependencies] anchor-lang = "0.22.0" clap = { version = "3.0.14", features = ["derive"] } -cronos-sdk = "0.1.3" +cronos-sdk = { path = "../sdk", version = "0.1.3" } serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" solana-account-decoder = "1.9.5" diff --git a/cli/src/app/admin.rs b/cli/src/app/admin.rs index c83d48562..204abbbcd 100644 --- a/cli/src/app/admin.rs +++ b/cli/src/app/admin.rs @@ -1,16 +1,16 @@ -use clap::{App, AppSettings, Arg}; +use clap::{Command, Arg}; -pub fn app() -> App<'static> { - App::new("admin") +pub fn app() -> Command<'static> { + Command::new("admin") .about("Run admin instructions against Cronos") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand(admin_cancel_app()) .subcommand(admin_health_app()) .subcommand(admin_initialize_app()) } -fn admin_cancel_app() -> App<'static> { - App::new("cancel").about("Cancels a scheduled task").arg( +fn admin_cancel_app() -> Command<'static> { + Command::new("cancel").about("Cancels a scheduled task").arg( Arg::new("address") .index(1) .takes_value(true) @@ -18,14 +18,14 @@ fn admin_cancel_app() -> App<'static> { ) } -fn admin_health_app() -> App<'static> { - App::new("health") +fn admin_health_app() -> Command<'static> { + Command::new("health") .about("Admin health commands") - .setting(AppSettings::SubcommandRequiredElseHelp) - .subcommand(App::new("reset").about("Resets the health account")) - .subcommand(App::new("start").about("Starts a new health check")) + .subcommand_required(true) + .subcommand(Command::new("reset").about("Resets the health account")) + .subcommand(Command::new("start").about("Starts a new health check")) } -fn admin_initialize_app() -> App<'static> { - App::new("initialize").about("Initializes the Cronos program") +fn admin_initialize_app() -> Command<'static> { + Command::new("initialize").about("Initializes the Cronos program") } diff --git a/cli/src/app/blocktime.rs b/cli/src/app/blocktime.rs index cfec6dee9..2fbf59d9f 100644 --- a/cli/src/app/blocktime.rs +++ b/cli/src/app/blocktime.rs @@ -1,5 +1,5 @@ -use clap::App; +use clap::Command; -pub fn app() -> App<'static> { - App::new("blocktime").about("Check the current Solana blocktime") +pub fn app() -> Command<'static> { + Command::new("blocktime").about("Check the current Solana blocktime") } diff --git a/cli/src/app/config.rs b/cli/src/app/config.rs index 3b5c50bcc..5b71a0609 100644 --- a/cli/src/app/config.rs +++ b/cli/src/app/config.rs @@ -1,22 +1,22 @@ -use clap::{App, AppSettings, Arg}; +use clap::{Command, Arg}; -pub fn app() -> App<'static> { - App::new("config") +pub fn app() -> Command<'static> { + Command::new("config") .about("Get Cronos program config info ") .subcommand(config_set_app()) } -fn config_set_app() -> App<'static> { - App::new("set") +fn config_set_app() -> Command<'static> { + Command::new("set") .about("Set Cronos config variables") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand(config_set_min_recurr_app()) .subcommand(config_set_program_fee_app()) .subcommand(config_set_worker_fee_app()) } -fn config_set_min_recurr_app() -> App<'static> { - App::new("min_recurr") +fn config_set_min_recurr_app() -> Command<'static> { + Command::new("min_recurr") .about("Update the minimum recurrence interval") .arg( Arg::new("new_value") @@ -27,8 +27,8 @@ fn config_set_min_recurr_app() -> App<'static> { ) } -fn config_set_program_fee_app() -> App<'static> { - App::new("program_fee").about("Update the program fee").arg( +fn config_set_program_fee_app() -> Command<'static> { + Command::new("program_fee").about("Update the program fee").arg( Arg::new("new_value") .index(1) .takes_value(true) @@ -37,8 +37,8 @@ fn config_set_program_fee_app() -> App<'static> { ) } -fn config_set_worker_fee_app() -> App<'static> { - App::new("worker_fee").about("Update the worker fee").arg( +fn config_set_worker_fee_app() -> Command<'static> { + Command::new("worker_fee").about("Update the worker fee").arg( Arg::new("new_value") .index(1) .takes_value(true) diff --git a/cli/src/app/cronos.rs b/cli/src/app/cronos.rs index 9f4f710a2..e6bf89d49 100644 --- a/cli/src/app/cronos.rs +++ b/cli/src/app/cronos.rs @@ -1,11 +1,11 @@ -use clap::{App, AppSettings}; +use clap::Command; -pub fn cronos() -> App<'static> { - App::new("Cronos") +pub fn cronos() -> Command<'static> { + Command::new("Cronos") .bin_name("cronos") .about("Cronos is an instruction scheduler for Solana") .version(version!()) - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand(super::admin::app()) .subcommand(super::blocktime::app()) .subcommand(super::config::app()) diff --git a/cli/src/app/daemon.rs b/cli/src/app/daemon.rs index 21c213d85..29d80d361 100644 --- a/cli/src/app/daemon.rs +++ b/cli/src/app/daemon.rs @@ -1,7 +1,7 @@ -use clap::App; +use clap::Command; -pub fn app() -> App<'static> { - App::new("daemon") +pub fn app() -> Command<'static> { + Command::new("daemon") .about("Manage your daemon") - .subcommand(App::new("new").about("Create a daemon account")) + .subcommand(Command::new("new").about("Create a daemon account")) } diff --git a/cli/src/app/health.rs b/cli/src/app/health.rs index 1c226389c..131bd37f2 100644 --- a/cli/src/app/health.rs +++ b/cli/src/app/health.rs @@ -1,7 +1,7 @@ -use clap::App; +use clap::Command; -pub fn app() -> App<'static> { - App::new("health") +pub fn app() -> Command<'static> { + Command::new("health") .about("Check the Cronos health") - .subcommand(App::new("reset").about("Reset the Cronos health tracker")) + .subcommand(Command::new("reset").about("Reset the Cronos health tracker")) } diff --git a/cli/src/app/task.rs b/cli/src/app/task.rs index db7669002..39e87e0d8 100644 --- a/cli/src/app/task.rs +++ b/cli/src/app/task.rs @@ -1,7 +1,7 @@ -use clap::{App, Arg}; +use clap::{Command, Arg}; -pub fn app() -> App<'static> { - App::new("task") +pub fn app() -> Command<'static> { + Command::new("task") .about("Manage your tasks") .subcommand(task_cancel_app()) .subcommand(task_new_app()) @@ -13,8 +13,8 @@ pub fn app() -> App<'static> { ) } -fn task_cancel_app() -> App<'static> { - App::new("cancel").about("Cancels a task").arg( +fn task_cancel_app() -> Command<'static> { + Command::new("cancel").about("Cancels a task").arg( Arg::new("address") .index(1) .takes_value(true) @@ -22,8 +22,8 @@ fn task_cancel_app() -> App<'static> { ) } -fn task_new_app() -> App<'static> { - App::new("new") +fn task_new_app() -> Command<'static> { + Command::new("new") .about("Creates a new task") .arg( Arg::new("filepath") diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index f65595480..c490096c9 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["solana", "cronos", "sdk"] [dependencies] anchor-client = { version = "0.22.0", features = ["debug"] } -cronos-program = { version = "0.1.3", features = ["no-entrypoint"] } +cronos-program = { path = "../programs/cronos", features = ["no-entrypoint"], version = "0.1.3" } solana-client-helpers = "1.1.0" solana-program = "1.9.5" solana-sdk = "1.9.8"