From c6b390822c775b8e921a1d0d2287bd256569fb10 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Thu, 18 Jul 2024 10:15:59 -0400 Subject: [PATCH] fix: use network only --- FULL_HELP_DOCS.md | 6 +----- cmd/soroban-cli/src/commands/tx/hash.rs | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index 9fbb894547..dd7acd8cbc 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -1234,17 +1234,13 @@ Simulate a transaction envelope from stdin Calculate the hash of a transaction envelope from stdin -**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 f8d0d7a5ac..d5b2c42e6e 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)?)