Skip to content

Commit 040a532

Browse files
authored
fix(PocketIC): do not override canister upgrade options (#6140)
This PR fixes the PocketIC library to not override canister upgrade options so that upgrading a Motoko EOP canister fails due to not persisting its WASM memory (instead of silently wiping its WASM memory).
1 parent b908b1b commit 040a532

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/pocket-ic/src/nonblocking.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ use ic_management_canister_types::{
2727
CanisterStatusResult, ChunkHash, DeleteCanisterSnapshotArgs, FetchCanisterLogsResult,
2828
InstallChunkedCodeArgs, InstallCodeArgs, LoadCanisterSnapshotArgs,
2929
ProvisionalCreateCanisterWithCyclesArgs, Snapshot, StoredChunksResult,
30-
TakeCanisterSnapshotArgs, UpdateSettingsArgs, UpgradeFlags as CanisterInstallModeUpgradeInner,
31-
UploadChunkArgs, UploadChunkResult,
32-
WasmMemoryPersistence as CanisterInstallModeUpgradeInnerWasmMemoryPersistenceInner,
30+
TakeCanisterSnapshotArgs, UpdateSettingsArgs, UploadChunkArgs, UploadChunkResult,
3331
};
3432
use ic_transport_types::Envelope;
3533
use ic_transport_types::EnvelopeContent::ReadState;
@@ -1158,12 +1156,7 @@ impl PocketIc {
11581156
sender: Option<Principal>,
11591157
) -> Result<(), RejectResponse> {
11601158
self.install_canister_helper(
1161-
CanisterInstallMode::Upgrade(Some(CanisterInstallModeUpgradeInner {
1162-
wasm_memory_persistence: Some(
1163-
CanisterInstallModeUpgradeInnerWasmMemoryPersistenceInner::Replace,
1164-
),
1165-
skip_pre_upgrade: Some(false),
1166-
})),
1159+
CanisterInstallMode::Upgrade(None),
11671160
canister_id,
11681161
wasm_module,
11691162
arg,

0 commit comments

Comments
 (0)