Skip to content

Commit

Permalink
fix: use network only
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Jul 16, 2024
1 parent b99e200 commit 300a6ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SOURCE_ACCOUNT>`
**Usage:** `stellar tx hash [OPTIONS]`

###### **Options:**

* `--rpc-url <RPC_URL>` — RPC server endpoint
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
* `--network <NETWORK>` — Name of network to use from config
* `--source-account <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 <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 <CONFIG_DIR>` — Location of config directory, default is "."



Expand Down
8 changes: 4 additions & 4 deletions cmd/soroban-cli/src/commands/tx/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)?)
Expand Down

0 comments on commit 300a6ca

Please sign in to comment.