From a2e3c2e1d1c992c7b79805ced613bd91805dacad Mon Sep 17 00:00:00 2001 From: Ravi Sawlani <152961362+ravibazz@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:40:40 +0530 Subject: [PATCH] feat: drop known_principal_ids from user_index canister (#231) --- src/canister/user_index/src/data_model/mod.rs | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/src/canister/user_index/src/data_model/mod.rs b/src/canister/user_index/src/data_model/mod.rs index 6a2ee3ed..06a9c1b3 100644 --- a/src/canister/user_index/src/data_model/mod.rs +++ b/src/canister/user_index/src/data_model/mod.rs @@ -2,7 +2,6 @@ use std::collections::{BTreeMap, HashSet}; use candid::{CandidType, Deserialize, Principal}; use serde::Serialize; -use shared_utils::common::types::known_principal::{KnownPrincipalMap, self}; use self::{canister_upgrade::UpgradeStatus, configuration::Configuration}; @@ -19,7 +18,6 @@ fn _default_vec_principal() -> HashSet { } #[derive(Default, CandidType, Serialize, Deserialize)] -#[serde(from = "CanisterDataV1")] pub struct CanisterData { pub configuration: Configuration, pub last_run_upgrade_status: UpgradeStatus, @@ -27,34 +25,4 @@ pub struct CanisterData { pub available_canisters: HashSet, pub user_principal_id_to_canister_id_map: BTreeMap, pub unique_user_name_to_user_principal_id_map: BTreeMap, -} - -impl From for CanisterData { - fn from(value: CanisterDataV1) -> Self { - let mut canister_data = CanisterData { - configuration: value.configuration, - last_run_upgrade_status: value.last_run_upgrade_status, - allow_upgrades_for_individual_canisters: value.allow_upgrades_for_individual_canisters, - user_principal_id_to_canister_id_map: value.user_principal_id_to_canister_id_map, - unique_user_name_to_user_principal_id_map: value.unique_user_name_to_user_principal_id_map, - available_canisters: value.available_canisters - - }; - canister_data.configuration.known_principal_ids = value.known_principal_ids; - - canister_data - } -} - - - -#[derive(Deserialize)] -pub struct CanisterDataV1 { - pub configuration: Configuration, - pub last_run_upgrade_status: UpgradeStatus, - pub allow_upgrades_for_individual_canisters: bool, - pub available_canisters: HashSet, - pub known_principal_ids: KnownPrincipalMap, - pub user_principal_id_to_canister_id_map: BTreeMap, - pub unique_user_name_to_user_principal_id_map: BTreeMap, } \ No newline at end of file