MCPcopy Create free account
hub / github.com/dfinity/orbit / upgrade

Method upgrade

core/upgrader/impl/src/upgrade.rs:62–83  ·  view source on GitHub ↗
(&self, ps: ChangeParams)

Source from the content-addressed store, hash-verified

60#[async_trait]
61impl Upgrade for Upgrader {
62 async fn upgrade(&self, ps: ChangeParams) -> Result<(), UpgradeError> {
63 let target_canister = get_target_canister();
64
65 match ps {
66 ChangeParams::Upgrade(ps) => install_chunked_code(
67 target_canister,
68 ps.install_mode,
69 ps.module,
70 ps.module_extra_chunks,
71 ps.arg,
72 )
73 .await
74 .map_err(|e| anyhow!(e).into()),
75 ChangeParams::Restore(ps) => load_canister_snapshot(LoadCanisterSnapshotArgs {
76 canister_id: target_canister,
77 snapshot_id: ps.snapshot_id,
78 sender_canister_version: Some(canister_version()),
79 })
80 .await
81 .map_err(|(_, e)| anyhow!(e).into()),
82 }
83 }
84}
85
86pub struct WithSnapshot<T>(pub T);

Callers 2

trigger_upgradeFunction · 0.80
trigger_restoreFunction · 0.80

Calls 12

get_target_canisterFunction · 0.85
install_chunked_codeFunction · 0.85
insert_backup_snapshotFunction · 0.85
spawnFunction · 0.85
printFunction · 0.85
callerFunction · 0.85
idFunction · 0.85
mapMethod · 0.80
containsMethod · 0.80
logMethod · 0.80
eqMethod · 0.45

Tested by

no test coverage detected