Skip to content

Commit

Permalink
revert change to replica-port
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Jan 7, 2025
1 parent f4d2ca4 commit 6acd8b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions e2e/tests-dfx/info.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ teardown() {
assert_command_fail dfx info pocketic-config-port
assert_contains "No PocketIC port found"
dfx_start
assert_command_fail dfx info native-replica-port
assert_command_fail dfx info replica-port
assert_contains "The running server is PocketIC"
assert_command dfx info pocketic-config-port
assert_eq "$(get_pocketic_port)"
else
assert_command_fail dfx info native-replica-port
assert_command_fail dfx info replica-port
assert_contains "No replica port found"
dfx_start
assert_command_fail dfx info pocketic-config-port
assert_contains "The running server is a native replica"
assert_command dfx info native-replica-port
assert_command dfx info replica-port
assert_eq "$(get_replica_port)"
fi
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/start.bash
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ teardown() {
if [[ "$USE_POCKETIC" ]]; then
assert_command dfx info pocketic-config-port
else
assert_command dfx info native-replica-port
assert_command dfx info replica-port
fi
assert_eq "$replica_port"
}
Expand Down
13 changes: 6 additions & 7 deletions src/dfx/src/commands/info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ enum InfoType {
CandidUiUrl,
/// Show the headers that gets applied to assets in .ic-assets.json5 if "security_policy" is "standard" or "hardened".
SecurityPolicy,
/// Show the port of the local IC API/webserver
#[command(alias = "webserver-port")]
ReplicaPort,
/// Show the port of the local IC API/HTTP gateway
WebserverPort,
/// Show the revision of the replica shipped with this dfx binary
ReplicaRev,
/// Show the path to network configuration file
NetworksJsonPath,
/// Show the port the native replica is using, if it is running
NativeReplicaPort,
/// Show the port the replica is using, if it is running
ReplicaPort,
/// Show the port that PocketIC is using, if it is running
PocketicConfigPort,
}
Expand Down Expand Up @@ -58,10 +57,10 @@ pub fn exec(env: &dyn Environment, opts: InfoOpts) -> DfxResult {
InfoType::SecurityPolicy => {
ic_asset::security_policy::SecurityPolicy::Standard.to_json5_str()
}
InfoType::NativeReplicaPort => get_replica_port(env)?,
InfoType::ReplicaPort => get_replica_port(env)?,
InfoType::PocketicConfigPort => get_pocketic_config_port(env)?,
InfoType::ReplicaRev => info::replica_rev().to_string(),
InfoType::ReplicaPort => get_webserver_port(env)?,
InfoType::WebserverPort => get_webserver_port(env)?,
InfoType::NetworksJsonPath => NetworksConfig::new()?
.get_path()
.to_str()
Expand Down

0 comments on commit 6acd8b4

Please sign in to comment.