Skip to content

Commit

Permalink
Add support for alias on stellar contract fetch. (#1404)
Browse files Browse the repository at this point in the history
* Add support for alias on `stellar contract fetch`.

* Address pr feedback.
  • Loading branch information
fnando authored Jun 25, 2024
1 parent 675f5d6 commit a1ea445
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/soroban-cli/src/commands/contract/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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()?;
Ok(self
.locator
.resolve_contract_id(&self.contract_id, &network.network_passphrase)?)
}
}

Expand Down

0 comments on commit a1ea445

Please sign in to comment.