Skip to content

Commit

Permalink
Add support for alias on stellar contract fetch.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Jun 24, 2024
1 parent 257c236 commit 6131dd4
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()?;
self.locator
.resolve_contract_id(&self.contract_id, &network.network_passphrase)
.map_err(Error::from)
}
}

Expand Down

0 comments on commit 6131dd4

Please sign in to comment.