ic_oss_types/
cluster.rs

1use candid::{CandidType, Principal};
2use serde::{Deserialize, Serialize};
3use serde_bytes::{ByteArray, ByteBuf};
4use std::collections::BTreeSet;
5
6#[derive(CandidType, Clone, Debug, Default, Deserialize, Serialize)]
7pub struct ClusterInfo {
8    pub name: String,
9    pub ecdsa_key_name: String,
10    pub schnorr_key_name: String,
11    pub ecdsa_token_public_key: String,
12    pub schnorr_ed25519_token_public_key: String,
13    pub weak_ed25519_token_public_key: String,
14    pub token_expiration: u64, // in seconds
15    pub managers: BTreeSet<Principal>,
16    pub committers: BTreeSet<Principal>,
17    pub subject_authz_total: u64,
18    pub bucket_latest_version: ByteArray<32>,
19    pub bucket_wasm_total: u64,
20    pub bucket_deployed_total: u64,
21    pub bucket_deployment_logs: u64,
22    pub governance_canister: Option<Principal>,
23}
24
25#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
26pub struct WasmInfo {
27    pub created_at: u64, // in milliseconds
28    pub created_by: Principal,
29    pub description: String,
30    pub wasm: ByteBuf,
31    pub hash: ByteArray<32>, // sha256 hash of the wasm data
32}
33
34#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
35pub struct AddWasmInput {
36    pub description: String,
37    pub wasm: ByteBuf,
38}
39
40#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
41pub struct DeployWasmInput {
42    pub canister: Principal,
43    pub args: Option<ByteBuf>,
44}
45
46#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
47pub struct BucketDeploymentInfo {
48    pub deploy_at: u64, // in milliseconds
49    pub canister: Principal,
50    pub prev_hash: ByteArray<32>,
51    pub wasm_hash: ByteArray<32>,
52    pub args: Option<ByteBuf>,
53    pub error: Option<String>,
54}