Skip to content

Commit

Permalink
Add network name as part of the alias file path.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Jun 5, 2024
1 parent c25ed7e commit 93b8b61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ impl Cmd {

fn save_contract_id(&self, contract: &String) -> Result<(), Error> {
let file_path = self.alias_path()?;

let Some(dir) = file_path.parent() else {
return Err(Error::CannotAccessConfigDir);
};
Expand Down
6 changes: 5 additions & 1 deletion cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,12 @@ impl Cmd {

fn alias_path(&self) -> Result<PathBuf, Error> {
let config_dir = self.config.config_dir()?;
let network = self.config.network.network.clone().expect("must be set");

Ok(config_dir.join("contract-ids").join(&self.contract_id))
Ok(config_dir
.join("contract-ids")
.join(network)
.join(&self.contract_id))
}

fn load_contract_id(&self) -> Result<Option<String>, Error> {
Expand Down

0 comments on commit 93b8b61

Please sign in to comment.