-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make
dfx info replica-port
pocketic-incompatible (#4056)
- Loading branch information
1 parent
90d18e9
commit 72f0cde
Showing
9 changed files
with
82 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use anyhow::bail; | ||
use dfx_core::network::provider::{create_network_descriptor, LocalBindDetermination}; | ||
|
||
use crate::lib::{environment::Environment, error::DfxResult}; | ||
|
||
pub(crate) fn get_pocketic_config_port(env: &dyn Environment) -> DfxResult<String> { | ||
let network_descriptor = create_network_descriptor( | ||
env.get_config()?, | ||
env.get_networks_config(), | ||
None, | ||
None, | ||
LocalBindDetermination::AsConfigured, | ||
)?; | ||
let local = network_descriptor.local_server_descriptor()?; | ||
match local.is_pocketic()? { | ||
Some(true) => {} | ||
Some(false) => bail!("The running server is a native replica, not PocketIC"), | ||
None => bail!("No PocketIC port found"), | ||
} | ||
let logger = None; | ||
if let Some(port) = local.get_running_pocketic_port(logger)? { | ||
Ok(format!("{}", port)) | ||
} else { | ||
bail!("No PocketIC port found"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters