File tree 2 files changed +34
-4
lines changed
src/ic-cdk/src/api/management_canister/main
2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 43
43
runs-on : ${{ matrix.os }}
44
44
strategy :
45
45
matrix :
46
- os : [ubuntu-latest, macos-12 ]
46
+ os : [ubuntu-latest, macos-13-large ]
47
47
steps :
48
48
- name : Checkout repository
49
49
uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -191,10 +191,10 @@ pub enum CanisterInstallMode {
191
191
Reinstall ,
192
192
/// Upgrade an existing canister.
193
193
#[ serde( rename = "upgrade" ) ]
194
- Upgrade ( Option < SkipPreUpgrade > ) ,
194
+ Upgrade ( Option < UpgradeFlags > ) ,
195
195
}
196
196
197
- /// If set to true, the pre_upgrade step will be skipped during the canister upgrade
197
+ /// Flags for canister installation with [`CanisterInstallMode::Upgrade`].
198
198
#[ derive(
199
199
CandidType ,
200
200
Serialize ,
@@ -209,7 +209,37 @@ pub enum CanisterInstallMode {
209
209
Copy ,
210
210
Default ,
211
211
) ]
212
- pub struct SkipPreUpgrade ( pub Option < bool > ) ;
212
+ pub struct UpgradeFlags {
213
+ /// If set to `true`, the `pre_upgrade` step will be skipped during the canister upgrade
214
+ pub skip_pre_upgrade : Option < bool > ,
215
+ /// If set to `Keep`, the WASM heap memory will be preserved instead of cleared.
216
+ pub wasm_memory_persistence : Option < WasmPersistenceMode > ,
217
+ }
218
+
219
+ /// WASM memory persistence setting for [`UpgradeFlags`].
220
+ #[ derive(
221
+ CandidType ,
222
+ Serialize ,
223
+ Deserialize ,
224
+ Debug ,
225
+ PartialEq ,
226
+ Eq ,
227
+ PartialOrd ,
228
+ Ord ,
229
+ Hash ,
230
+ Clone ,
231
+ Copy ,
232
+ Default ,
233
+ ) ]
234
+ pub enum WasmPersistenceMode {
235
+ /// Preserve heap memory (only officially supported by Motoko)
236
+ #[ serde( rename = "keep" ) ]
237
+ Keep ,
238
+ /// Clear heap memory
239
+ #[ serde( rename = "replace" ) ]
240
+ #[ default]
241
+ Replace ,
242
+ }
213
243
214
244
/// WASM module.
215
245
pub type WasmModule = Vec < u8 > ;
You can’t perform that action at this time.
0 commit comments