From 6131dd42b21b0439f1fbe3b81e42af9e29cb0f2b Mon Sep 17 00:00:00 2001 From: Nando Vieira Date: Mon, 24 Jun 2024 16:03:16 -0700 Subject: [PATCH] Add support for alias on `stellar contract fetch`. --- cmd/soroban-cli/src/commands/contract/fetch.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/soroban-cli/src/commands/contract/fetch.rs b/cmd/soroban-cli/src/commands/contract/fetch.rs index e9d73db98f..0dbcee3d8e 100644 --- a/cmd/soroban-cli/src/commands/contract/fetch.rs +++ b/cmd/soroban-cli/src/commands/contract/fetch.rs @@ -24,7 +24,7 @@ use crate::commands::network::{self, Network}; use crate::commands::{global, NetworkRunnable}; use crate::{ rpc::{self, Client}, - utils, Pwd, + Pwd, }; #[derive(Parser, Debug, Default, Clone)] @@ -124,8 +124,10 @@ impl Cmd { } fn contract_id(&self) -> Result<[u8; 32], Error> { - utils::contract_id_from_str(&self.contract_id) - .map_err(|e| Error::CannotParseContractId(self.contract_id.clone(), e)) + let network = self.network()?; + self.locator + .resolve_contract_id(&self.contract_id, &network.network_passphrase) + .map_err(Error::from) } }