Skip to content

Commit

Permalink
fix: resolve contract id
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Oct 30, 2024
1 parent 1c3f4d2 commit 1942702
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/soroban-cli/src/commands/contract/info/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct Args {
/// Wasm hash to get the data for
#[arg(long = "wasm-hash", group = "Source")]
pub wasm_hash: Option<String>,
/// 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<String>,
#[command(flatten)]
Expand Down Expand Up @@ -79,6 +79,9 @@ pub async fn fetch_wasm(args: &Args) -> Result<Option<Vec<u8>>, 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);
Expand Down

0 comments on commit 1942702

Please sign in to comment.