Skip to content

Commit 6e99e39

Browse files
committed
add deprecation warning for put-deploy subcommand
1 parent 03303a5 commit 6e99e39

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

lib/cli/deploy.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub async fn put_deploy(
3232
let rpc_id = parse::rpc_id(maybe_rpc_id);
3333
let verbosity = parse::verbosity(verbosity_level);
3434
let deploy = with_payment_and_session(deploy_params, payment_params, session_params, false)?;
35+
#[allow(deprecated)]
3536
crate::put_deploy(rpc_id, node_address, verbosity, deploy)
3637
.await
3738
.map_err(CliError::from)
@@ -115,6 +116,7 @@ pub async fn send_deploy_file(
115116
let rpc_id = parse::rpc_id(maybe_rpc_id);
116117
let verbosity = parse::verbosity(verbosity_level);
117118
let deploy = crate::read_deploy_file(input_path)?;
119+
#[allow(deprecated)]
118120
crate::put_deploy(rpc_id, node_address, verbosity, deploy)
119121
.await
120122
.map_err(CliError::from)
@@ -170,6 +172,7 @@ pub async fn transfer(
170172
payment_params,
171173
false,
172174
)?;
175+
#[allow(deprecated)]
173176
crate::put_deploy(rpc_id, node_address, verbosity, deploy)
174177
.await
175178
.map_err(CliError::from)

lib/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub const MAX_SERIALIZED_SIZE_OF_DEPLOY: u32 = 1_024 * 1_024;
134134
/// Sends a JSON-RPC `account_put_deploy` request to the specified node.
135135
///
136136
/// For details of the parameters, see [the module docs](crate#common-parameters).
137+
#[deprecated(since = "3.0.0", note = "use `put_transaction` instead")]
137138
pub async fn put_deploy(
138139
rpc_id: JsonRpcId,
139140
node_address: &str,

src/deploy/put.rs

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

99
pub struct PutDeploy;
1010

11+
static DEPRECATION_WARNING: &str = r#"
12+
#################################### WARNING ####################################
13+
# #
14+
# put-deploy subcommand is deprecated in favor of put-transaction #
15+
# and will be removed in a future release #
16+
# #
17+
#################################################################################
18+
"#;
19+
1120
#[async_trait]
1221
impl ClientCommand for PutDeploy {
1322
const NAME: &'static str = "put-deploy";
14-
const ABOUT: &'static str = "Create a deploy and send it to the network for execution";
23+
const ABOUT: &'static str =
24+
"[DEPRECATED: use `put-transaction` instead] Create a deploy and send it to the network for execution";
1525

1626
fn build(display_order: usize) -> Command {
1727
let subcommand = Command::new(Self::NAME)
@@ -27,6 +37,9 @@ impl ClientCommand for PutDeploy {
2737
}
2838

2939
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
40+
// show deprecation warning for each use of `put-deploy` subcommand
41+
println!("{DEPRECATION_WARNING}");
42+
3043
creation_common::show_simple_arg_examples_and_exit_if_required(matches);
3144
creation_common::show_json_args_examples_and_exit_if_required(matches);
3245

0 commit comments

Comments
 (0)