From 122df3113accbdd2ceb64d06d95dccee9fc5eec9 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Wed, 30 Oct 2024 09:50:27 -0400 Subject: [PATCH] fix: resolve contract id --- cmd/soroban-cli/src/commands/contract/info/shared.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/soroban-cli/src/commands/contract/info/shared.rs b/cmd/soroban-cli/src/commands/contract/info/shared.rs index 0974632ae..9c24d78b8 100644 --- a/cmd/soroban-cli/src/commands/contract/info/shared.rs +++ b/cmd/soroban-cli/src/commands/contract/info/shared.rs @@ -24,7 +24,7 @@ pub struct Args { /// Wasm hash to get the data for #[arg(long = "wasm-hash", group = "Source")] pub wasm_hash: Option, - /// Contract id to get the data for + /// Contract id or contract alias to get the data for #[arg(long = "id", env = "STELLAR_CONTRACT_ID", group = "Source")] pub contract_id: Option, #[command(flatten)] @@ -79,6 +79,9 @@ pub async fn fetch_wasm(args: &Args) -> Result>, Error> { get_remote_wasm_from_hash(&client, &hash).await? } else if let Some(contract_id) = &args.contract_id { + let contract_id = args + .locator + .resolve_contract_id(contract_id, &network.network_passphrase)?; let res = wasm::fetch_from_contract(contract_id, network, &args.locator).await; if let Some(ContractIsStellarAsset) = res.as_ref().err() { return Ok(None);