Skip to content

Commit d359b6a

Browse files
committed
fix:requested changes
1 parent 205adf7 commit d359b6a

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

cmd/soroban-cli/src/commands/contract/info.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub mod env_meta;
66
pub mod interface;
77
pub mod meta;
88
pub mod shared;
9+
pub mod wasm_hash;
910

1011
#[derive(Debug, clap::Subcommand)]
1112
pub enum Cmd {
@@ -49,6 +50,9 @@ pub enum Cmd {
4950
///
5051
/// Outputs no data when no data is present in the contract.
5152
EnvMeta(env_meta::Cmd),
53+
54+
/// Get the wasm hash of a deployed contract
55+
WasmHash(wasm_hash::Cmd),
5256
}
5357

5458
#[derive(thiserror::Error, Debug)]
@@ -59,6 +63,8 @@ pub enum Error {
5963
Meta(#[from] meta::Error),
6064
#[error(transparent)]
6165
EnvMeta(#[from] env_meta::Error),
66+
#[error(transparent)]
67+
WasmHash(#[from] wasm_hash::Error),
6268
}
6369

6470
impl Cmd {
@@ -67,6 +73,7 @@ impl Cmd {
6773
Cmd::Interface(interface) => interface.run(global_args).await?,
6874
Cmd::Meta(meta) => meta.run(global_args).await?,
6975
Cmd::EnvMeta(env_meta) => env_meta.run(global_args).await?,
76+
Cmd::WasmHash(cmd) => cmd.run(global_args).await?,
7077
};
7178
println!("{result}");
7279
Ok(())

cmd/soroban-cli/src/commands/contract/info/wasm_hash.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Cmd {
2121
pub network: network::Args,
2222

2323
/// Contract ID to get the wasm hash for
24-
#[arg(long = "contract-id")]
24+
#[arg(long)]
2525
pub contract_id: stellar_strkey::Contract,
2626
}
2727

@@ -65,9 +65,3 @@ impl Cmd {
6565
}
6666
}
6767

68-
pub fn subcommand() -> Command {
69-
command!("wasm-hash")
70-
.about("Retrieve the wasm hash of a contract")
71-
.arg(arg!(--network <NETWORK> "The network to connect to"))
72-
.arg(arg!(--contract-id <CONTRACT_ID> "The contract ID"))
73-
}

cmd/soroban-cli/src/commands/contract/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub mod optimize;
1515
pub mod read;
1616
pub mod restore;
1717
pub mod upload;
18-
pub mod wasm_hash;
18+
1919

2020
use crate::{commands::global, print::Print};
2121

@@ -93,8 +93,6 @@ pub enum Cmd {
9393
/// If no keys are specificed the contract itself is restored.
9494
Restore(restore::Cmd),
9595

96-
/// Get the wasm hash of a deployed contract
97-
WasmHash(wasm_hash::Cmd),
9896
}
9997

10098
#[derive(thiserror::Error, Debug)]
@@ -147,8 +145,6 @@ pub enum Error {
147145
#[error(transparent)]
148146
Restore(#[from] restore::Error),
149147

150-
#[error(transparent)]
151-
WasmHash(#[from] wasm_hash::Error),
152148
}
153149

154150
impl Cmd {
@@ -176,7 +172,6 @@ impl Cmd {
176172
Cmd::Fetch(fetch) => fetch.run().await?,
177173
Cmd::Read(read) => read.run().await?,
178174
Cmd::Restore(restore) => restore.run().await?,
179-
Cmd::WasmHash(cmd) => cmd.run(global_args).await?,
180175
}
181176
Ok(())
182177
}

0 commit comments

Comments
 (0)