Skip to content

Commit 3ff699a

Browse files
authored
Merge pull request #231 from teonite/rename_transaction_path
Rename transaction-path arg to wasm-path
2 parents 7450440 + 92a8fe1 commit 3ff699a

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

lib/json_rpc/call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use serde_json::json;
1010

1111
const RPC_API_PATH: &str = "rpc";
1212
#[cfg(not(target_arch = "wasm32"))]
13-
const REQUEST_TIMEOUT: Duration = Duration::from_secs(5);
13+
const REQUEST_TIMEOUT: Duration = Duration::from_secs(15);
1414

1515
/// Statically declared client used when making HTTP requests
1616
/// so opened connections are pooled.

src/deploy/creation_common.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,9 @@ pub(super) fn apply_common_creation_options(
572572
);
573573

574574
if include_node_address {
575-
subcommand = subcommand.arg(
576-
common::node_address::arg(DisplayOrder::NodeAddress as usize)
577-
.required_unless_present(show_simple_arg_examples::ARG_NAME)
578-
.required_unless_present(show_json_args_examples::ARG_NAME),
579-
);
575+
subcommand = subcommand.arg(common::node_address::arg(
576+
DisplayOrder::NodeAddress as usize,
577+
));
580578
}
581579

582580
let secret_key_arg = if require_secret_key {

src/transaction/creation_common.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,9 @@ pub(super) fn apply_common_creation_options(
690690
include_transaction_args: bool,
691691
) -> Command {
692692
if include_node_address {
693-
subcommand = subcommand.arg(
694-
common::node_address::arg(DisplayOrder::NodeAddress as usize)
695-
.required_unless_present(show_simple_arg_examples::ARG_NAME)
696-
.required_unless_present(show_json_args_examples::ARG_NAME),
697-
);
693+
subcommand = subcommand.arg(common::node_address::arg(
694+
DisplayOrder::NodeAddress as usize,
695+
));
698696
}
699697

700698
let secret_key_arg = if require_secret_key {
@@ -817,13 +815,13 @@ pub(super) mod output {
817815
}
818816
}
819817

820-
pub(super) mod transaction_path {
818+
pub(super) mod wasm_path {
821819
use super::*;
822820

823-
const ARG_NAME: &str = "transaction-path";
824-
const ARG_SHORT: char = 't';
821+
const ARG_NAME: &str = "wasm-path";
822+
const ARG_SHORT: char = 'w';
825823
const ARG_VALUE_NAME: &str = common::ARG_PATH;
826-
const ARG_HELP: &str = "Path to input transaction file";
824+
const ARG_HELP: &str = "Path to compiled Wasm session code";
827825

828826
pub fn arg() -> Arg {
829827
Arg::new(ARG_NAME)
@@ -2284,17 +2282,16 @@ pub(super) mod session {
22842282
show_simple_arg_examples_and_exit_if_required(matches);
22852283
show_json_args_examples_and_exit_if_required(matches);
22862284

2287-
let transaction_path_str = transaction_path::get(matches);
2285+
let wasm_path_str = wasm_path::get(matches);
22882286

2289-
if transaction_path_str.is_none() {
2287+
if wasm_path_str.is_none() {
22902288
return Err(CliError::InvalidArgument {
2291-
context: "transaction_path",
2292-
error: "Transaction path cannot be empty".to_string(),
2289+
context: "wasm_path",
2290+
error: "Wasm path cannot be empty".to_string(),
22932291
});
22942292
}
22952293

2296-
let transaction_bytes =
2297-
parse::transaction_module_bytes(transaction_path_str.unwrap_or_default())?;
2294+
let transaction_bytes = parse::transaction_module_bytes(wasm_path_str.unwrap_or_default())?;
22982295

22992296
let is_install_upgrade: bool = is_install_upgrade::get(matches);
23002297
let runtime = get_transaction_runtime(matches)?;
@@ -2310,7 +2307,7 @@ pub(super) mod session {
23102307

23112308
fn add_args(session_subcommand: Command) -> Command {
23122309
session_subcommand
2313-
.arg(transaction_path::arg())
2310+
.arg(wasm_path::arg())
23142311
.arg(session_entry_point::arg())
23152312
.arg(is_install_upgrade::arg(
23162313
DisplayOrder::IsInstallUpgrade as usize,

src/transaction/send.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ impl ClientCommand for SendTransaction {
2828
))
2929
.arg(common::rpc_id::arg(DisplayOrder::RpcId as usize))
3030
.arg(creation_common::speculative_exec::arg())
31-
.arg(creation_common::transaction_path::arg())
31+
.arg(creation_common::wasm_path::arg())
3232
}
3333

3434
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
3535
let is_speculative_exec = creation_common::speculative_exec::get(matches);
3636
let maybe_rpc_id = common::rpc_id::get(matches);
3737
let node_address = common::node_address::get(matches);
3838
let verbosity_level = common::verbose::get(matches);
39-
let input_path = creation_common::transaction_path::get(matches).unwrap_or_default();
39+
let input_path = creation_common::wasm_path::get(matches).unwrap_or_default();
4040
if input_path.is_empty() {
4141
return Err(CliError::InvalidArgument {
4242
context: "send_deploy",

src/transaction/sign.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl ClientCommand for SignTransaction {
2323
common::secret_key::arg(creation_common::DisplayOrder::SecretKey as usize, "")
2424
.required(true),
2525
)
26-
.arg(creation_common::transaction_path::arg())
26+
.arg(creation_common::wasm_path::arg())
2727
.arg(creation_common::output::arg())
2828
.arg(common::force::arg(
2929
creation_common::DisplayOrder::Force as usize,
@@ -32,7 +32,7 @@ impl ClientCommand for SignTransaction {
3232
}
3333

3434
async fn run(matches: &ArgMatches) -> Result<Success, CliError> {
35-
let input_path = creation_common::transaction_path::get(matches).unwrap_or_default();
35+
let input_path = creation_common::wasm_path::get(matches).unwrap_or_default();
3636
let secret_key = common::secret_key::get(matches).unwrap_or_default();
3737
let maybe_output_path = creation_common::output::get(matches).unwrap_or_default();
3838
let force = common::force::get(matches);

0 commit comments

Comments
 (0)