ic_test_state_machine_client/
management_canister.rs1use candid::{CandidType, Nat, Principal};
8use serde::{Deserialize, Serialize};
9
10pub(crate) type CanisterId = Principal;
11
12#[derive(
13 CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
14)]
15pub struct CanisterSettings {
16 pub controllers: Option<Vec<Principal>>,
18 pub compute_allocation: Option<Nat>,
20 pub memory_allocation: Option<Nat>,
22 pub freezing_threshold: Option<Nat>,
24}
25
26#[derive(
28 CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default,
29)]
30pub(crate) struct CreateCanisterArgument {
31 pub settings: Option<CanisterSettings>,
33}
34
35#[derive(
36 CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy,
37)]
38pub(crate) enum CanisterInstallMode {
40 #[serde(rename = "install")]
42 Install,
43 #[serde(rename = "reinstall")]
45 Reinstall,
46 #[serde(rename = "upgrade")]
48 Upgrade,
49}
50
51pub(crate) type WasmModule = Vec<u8>;
52
53#[derive(
54 CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone,
55)]
56pub(crate) struct InstallCodeArgument {
57 pub mode: CanisterInstallMode,
59 pub canister_id: CanisterId,
61 pub wasm_module: WasmModule,
63 pub arg: Vec<u8>,
65}
66
67#[derive(
69 CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy,
70)]
71pub(crate) struct CanisterIdRecord {
72 pub canister_id: CanisterId,
74}