diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index 96d8d9c70..ca6c9af93 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -1232,17 +1232,13 @@ Simulate a transaction envelope from stdin Calculate the hash of a transaction envelope from stdin and prints it as a hex string -**Usage:** `stellar tx hash [OPTIONS] --source-account ` +**Usage:** `stellar tx hash [OPTIONS]` ###### **Options:** * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config -* `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…") -* `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` -* `--global` — Use global config -* `--config-dir ` — Location of config directory, default is "." diff --git a/cmd/soroban-cli/src/commands/tx/hash.rs b/cmd/soroban-cli/src/commands/tx/hash.rs index f8d0d7a5a..d5b2c42e6 100644 --- a/cmd/soroban-cli/src/commands/tx/hash.rs +++ b/cmd/soroban-cli/src/commands/tx/hash.rs @@ -8,7 +8,7 @@ pub enum Error { #[error(transparent)] XdrToBase64(#[from] soroban_env_host::xdr::Error), #[error(transparent)] - Config(#[from] super::super::config::Error), + Config(#[from] super::super::network::Error), } // Command to return the transaction hash submitted to a network @@ -17,13 +17,13 @@ pub enum Error { #[group(skip)] pub struct Cmd { #[clap(flatten)] - pub config: super::super::config::Args, + pub network: super::super::network::Args, } impl Cmd { - pub fn run(&self, _global_args: &global::Args) -> Result<(), Error> { + pub fn run(&self, global_args: &global::Args) -> Result<(), Error> { let tx = super::xdr::unwrap_envelope_v1(super::xdr::tx_envelope_from_stdin()?)?; - let network = &self.config.get_network()?; + let network = &self.network.get(&global_args.locator)?; println!( "{}", hex::encode(transaction_hash(&tx, &network.network_passphrase)?)