From 234c2a36b50f713c1ce8ce96e3ee2877946618ad Mon Sep 17 00:00:00 2001 From: mraszyk <31483726+mraszyk@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:45:39 +0100 Subject: [PATCH] fix: dfx start --pocketic does not require --clean (#3984) * fix: dfx start --pocketic does not require --clean * force * fix --- e2e/tests-dfx/start.bash | 8 ++++++++ src/dfx-core/src/config/model/replica_config.rs | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/e2e/tests-dfx/start.bash b/e2e/tests-dfx/start.bash index bdfd7d25d6..417a84f180 100644 --- a/e2e/tests-dfx/start.bash +++ b/e2e/tests-dfx/start.bash @@ -21,6 +21,14 @@ teardown() { assert_command diff "$NETWORK_ID_PATH" "$NETWORK_ID_BY_SETTINGS_DIGEST_PATH" } +@test "start and stop" { + dfx_start + dfx_stop + + dfx_start + dfx_stop +} + @test "start and stop with different options" { [[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: clean required" dfx_start --artificial-delay 101 diff --git a/src/dfx-core/src/config/model/replica_config.rs b/src/dfx-core/src/config/model/replica_config.rs index ed4164b56d..510f0420e3 100644 --- a/src/dfx-core/src/config/model/replica_config.rs +++ b/src/dfx-core/src/config/model/replica_config.rs @@ -222,7 +222,8 @@ impl<'a> CachedConfig<'a> { } } pub fn can_share_state(&self, other: &Self) -> bool { - self == other + // effective canister id does not matter for ability to share state + self.replica_rev == other.replica_rev && self.config == other.config } pub fn get_effective_canister_id(&self) -> Option { self.effective_canister_id