(&self, ps: ChangeParams)
| 60 | #[async_trait] |
| 61 | impl 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 | |
| 86 | pub struct WithSnapshot<T>(pub T); |
no test coverage detected