Skip to content

Commit

Permalink
Lower case Wasm memory persistence modes
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-blaeser committed Jan 16, 2025
1 parent cef9238 commit 12d0205
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/mo_types/type.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1420,8 +1420,8 @@ let canister_settings_typ =

let wasm_memory_persistence_typ =
sum [
("Keep", unit);
("Replace", unit);
("keep", unit);
("replace", unit);
]

let upgrade_with_persistence_option_typ =
Expand Down
6 changes: 3 additions & 3 deletions src/prelude/internals.mo
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ module @ManagementCanister = {
};
type @WasmMemoryPersistence = {
#Keep;
#Replace;
#keep;
#replace;
};
type @UpgradeOptions = {
Expand Down Expand Up @@ -460,7 +460,7 @@ func @install_actor_helper(
};
case (#upgrade actor2) {
let wasm_memory_persistence = if enhanced_orthogonal_persistence {
?(#Keep)
?(#keep)
} else {
null
};
Expand Down
4 changes: 2 additions & 2 deletions test/run-drun/actor-class-mgmt-enhanced.mo
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ actor a {
assert (c5 == c4);

let c6 = await
(system Cs.C)(#upgrade_with_persistence { wasm_memory_persistence = #Keep ; canister = c5 })(6, null);
(system Cs.C)(#upgrade_with_persistence { wasm_memory_persistence = #keep ; canister = c5 })(6, null);
assert ({args = 6; upgrades = 3} == (await c6.observe()));
assert (c6 == c5);

Expand All @@ -135,7 +135,7 @@ actor a {

// no need to add cycles
let c8 = await
(system Cs.C)(#upgrade_with_persistence { wasm_memory_persistence = #Replace ; canister = c7 })(8, null);
(system Cs.C)(#upgrade_with_persistence { wasm_memory_persistence = #replace ; canister = c7 })(8, null);
assert ({args = 8; upgrades = 0} == (await c8.observe()));
assert (c8 == c7);

Expand Down
4 changes: 2 additions & 2 deletions test/run-drun/map-mixed-upgrades/map0.mo
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ actor a {
case null {};
case (?n) {
nodes[i] :=
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #Keep; canister = n })(i)); // upgrade!
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #keep; canister = n })(i)); // upgrade!
}
}
}
Expand All @@ -80,7 +80,7 @@ actor a {
case null {};
case (?n) {
nodes[i] :=
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #Replace; canister = n })(i)); // upgrade!
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #replace; canister = n })(i)); // upgrade!
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/run-drun/map-mixed-upgrades/map1.mo
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ actor a {
case null {};
case (?n) {
nodes[i] :=
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #Keep; canister = n })(i)); // upgrade!
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #keep; canister = n })(i)); // upgrade!
}
}
}
Expand All @@ -91,7 +91,7 @@ actor a {
case null {};
case (?n) {
nodes[i] :=
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #Replace; canister = n })(i)); // upgrade!
? (await (system Lib.Node)(#upgrade_with_persistence { wasm_memory_persistence = #replace; canister = n })(i)); // upgrade!
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/run-drun/migration-paths/new-installer.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ actor {
switch testCanister {
case null Prim.trap("null canister");
case (?canister) {
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #Keep; canister })();
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #keep; canister })();
Prim.debugPrint("Upgraded (keep main memory)");
};
};
Expand All @@ -29,7 +29,7 @@ actor {
switch testCanister {
case null Prim.trap("null canister");
case (?canister) {
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #Replace; canister })();
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #replace; canister })();
Prim.debugPrint("Upgraded (replace main memory)");
};
};
Expand Down
4 changes: 2 additions & 2 deletions test/run-drun/migration-paths/old-installer.mo
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ actor installer {
switch testCanister {
case null Prim.trap("null canister");
case (?canister) {
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #Keep; canister })();
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #keep; canister })();
Prim.debugPrint("Upgraded (keep main memory)");
}
}
Expand All @@ -41,7 +41,7 @@ actor installer {
switch testCanister {
case null Prim.trap("null canister");
case (?canister) {
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #Replace; canister })();
ignore await (system TestCanister.TestCanister)(#upgrade_with_persistence { wasm_memory_persistence = #replace; canister })();
Prim.debugPrint("Upgraded (replace main memory)");
}
}
Expand Down

0 comments on commit 12d0205

Please sign in to comment.