Skip to content

Commit 0a9a5f1

Browse files
committed
add depracation warnings for remaining deploy-related subcommands
1 parent 6e99e39 commit 0a9a5f1

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

src/deploy/make.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ use crate::{command::ClientCommand, common, Success};
88

99
pub struct MakeDeploy;
1010

11+
static DEPRECATION_WARNING: &str = r#"
12+
#################################### WARNING ####################################
13+
# #
14+
# make-deploy subcommand is deprecated in favor of make-transaction #
15+
# and will be removed in a future release #
16+
# #
17+
#################################################################################
18+
"#;
19+
1120
#[async_trait]
1221
impl ClientCommand for MakeDeploy {
1322
const NAME: &'static str = "make-deploy";
1423
const ABOUT: &'static str =
15-
"Create a deploy and output it to a file or stdout. As a file, the deploy can subsequently \
24+
"[DEPRECATED: use `make-transaction` instead] Create a deploy and output it to a file or stdout. As a file, the deploy can subsequently \
1625
be signed by other parties using the 'sign-deploy' subcommand and then sent to the network \
1726
for execution using the 'send-deploy' subcommand";
1827

@@ -32,6 +41,9 @@ impl ClientCommand for MakeDeploy {
3241
}
3342

3443
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
44+
// show deprecation warning for each use of `put-deploy` subcommand
45+
println!("{DEPRECATION_WARNING}");
46+
3547
creation_common::show_simple_arg_examples_and_exit_if_required(matches);
3648
creation_common::show_json_args_examples_and_exit_if_required(matches);
3749
let gas_price = creation_common::gas_price::get(matches);

src/deploy/send.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@ use crate::{command::ClientCommand, common, Success};
99

1010
pub struct SendDeploy;
1111

12+
static DEPRECATION_WARNING: &str = r#"
13+
#################################### WARNING ####################################
14+
# #
15+
# send-deploy subcommand is deprecated in favor of send-transaction #
16+
# and will be removed in a future release #
17+
# #
18+
#################################################################################
19+
"#;
20+
1221
#[async_trait]
1322
impl ClientCommand for SendDeploy {
1423
const NAME: &'static str = "send-deploy";
1524
const ABOUT: &'static str =
16-
"Read a previously-saved deploy from a file and send it to the network for execution";
25+
"[DEPRECATED: use `send-transaction` instead] Read a previously-saved deploy from a file and send it to the network for execution";
1726

1827
fn build(display_order: usize) -> Command {
1928
Command::new(Self::NAME)
@@ -29,6 +38,9 @@ impl ClientCommand for SendDeploy {
2938
}
3039

3140
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
41+
// show deprecation warning for each use of `send-deploy` subcommand
42+
println!("{DEPRECATION_WARNING}");
43+
3244
let is_speculative_exec = creation_common::speculative_exec::get(matches);
3345
let maybe_rpc_id = common::rpc_id::get(matches);
3446
let node_address = common::node_address::get(matches);

src/deploy/sign.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ use crate::{command::ClientCommand, common, Success};
88

99
pub struct SignDeploy;
1010

11+
static DEPRECATION_WARNING: &str = r#"
12+
#################################### WARNING ####################################
13+
# #
14+
# sign-deploy subcommand is deprecated in favor of sign-transaction #
15+
# and will be removed in a future release #
16+
# #
17+
#################################################################################
18+
"#;
19+
1120
#[async_trait]
1221
impl ClientCommand for SignDeploy {
1322
const NAME: &'static str = "sign-deploy";
1423
const ABOUT: &'static str =
15-
"Read a previously-saved deploy from a file, cryptographically sign it, and output it to a \
24+
"[DEPRECATED: use `sign-transaction` instead] Read a previously-saved deploy from a file, cryptographically sign it, and output it to a \
1625
file or stdout";
1726

1827
fn build(display_order: usize) -> Command {
@@ -32,6 +41,9 @@ impl ClientCommand for SignDeploy {
3241
}
3342

3443
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
44+
// show deprecation warning for each use of `sign-deploy` subcommand
45+
println!("{DEPRECATION_WARNING}");
46+
3547
let input_path = creation_common::input::get(matches);
3648
let secret_key = common::secret_key::get(matches).unwrap_or_default();
3749
let maybe_output_path = creation_common::output::get(matches).unwrap_or_default();

0 commit comments

Comments
 (0)