A helper function to write the canister configuration.
(config: CanisterConfig)
| 57 | |
| 58 | /// A helper function to write the canister configuration. |
| 59 | pub fn write_canister_config(config: CanisterConfig) { |
| 60 | CONFIG.with(|cell| { |
| 61 | cell.borrow_mut() |
| 62 | .set(CanisterState::Initialized(config)) |
| 63 | .expect("failed to write canister config"); |
| 64 | }); |
| 65 | } |
| 66 | |
| 67 | #[cfg(test)] |
| 68 | mod tests { |