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

Function trigger_upgrade

core/upgrader/impl/src/lib.rs:156–174  ·  view source on GitHub ↗
(params: upgrader_api::UpgradeParams)

Source from the content-addressed store, hash-verified

154
155#[update]
156async fn trigger_upgrade(params: upgrader_api::UpgradeParams) -> Result<(), TriggerUpgradeError> {
157 let input: UpgradeParams = UpgradeParams {
158 module: params.module,
159 module_extra_chunks: params.module_extra_chunks,
160 arg: params.arg,
161 install_mode: CanisterInstallMode::Upgrade(None),
162 take_backup_snapshot: params.take_backup_snapshot.unwrap_or_default(),
163 };
164 UPGRADER
165 .upgrade(ChangeParams::Upgrade(input))
166 .await
167 .map_err(|err| match err {
168 UpgradeError::NotController => TriggerUpgradeError::NotController,
169 UpgradeError::Unauthorized => TriggerUpgradeError::Unauthorized,
170 UpgradeError::UnexpectedError(err) => {
171 TriggerUpgradeError::UnexpectedError(err.to_string())
172 }
173 })
174}
175
176#[update]
177async fn trigger_restore(params: upgrader_api::RestoreParams) -> Result<(), TriggerRestoreError> {

Callers

nothing calls this directly

Calls 2

UpgradeInterface · 0.85
upgradeMethod · 0.80

Tested by

no test coverage detected