From 30f5f5965b3347bfca1671737e07eb89c916cd2f Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 30 Sep 2024 11:47:55 +0200 Subject: [PATCH] YAGNI --- .../helpers/is_derivation_done_query.rs | 20 ---------------- src/recovery_securify_cache/helpers/mod.rs | 6 ----- .../helpers/on_chain_key_status_analyzer.rs | 22 ------------------ .../helpers/profile_key_status_analyzer.rs | 23 ------------------- 4 files changed, 71 deletions(-) delete mode 100644 src/recovery_securify_cache/helpers/is_derivation_done_query.rs delete mode 100644 src/recovery_securify_cache/helpers/on_chain_key_status_analyzer.rs delete mode 100644 src/recovery_securify_cache/helpers/profile_key_status_analyzer.rs diff --git a/src/recovery_securify_cache/helpers/is_derivation_done_query.rs b/src/recovery_securify_cache/helpers/is_derivation_done_query.rs deleted file mode 100644 index c2141c82..00000000 --- a/src/recovery_securify_cache/helpers/is_derivation_done_query.rs +++ /dev/null @@ -1,20 +0,0 @@ -use crate::prelude::*; - -/// An async GUI callback allowing us to ask user -/// if she is content with the derivations (recovered -/// accounts) so far. -#[async_trait::async_trait] -pub trait IsDerivationDoneQuery { - async fn is_done(&self, intermediary: &IntermediaryDerivationAndAnalysis) -> Result; -} - -/// Simplest possible implementation of `IsDerivationDoneQuery` -/// which immediately returns `true` -pub struct YesDone; - -#[async_trait::async_trait] -impl IsDerivationDoneQuery for YesDone { - async fn is_done(&self, _intermediary: &IntermediaryDerivationAndAnalysis) -> Result { - Ok(true) - } -} diff --git a/src/recovery_securify_cache/helpers/mod.rs b/src/recovery_securify_cache/helpers/mod.rs index 4d8bd046..b40426e4 100644 --- a/src/recovery_securify_cache/helpers/mod.rs +++ b/src/recovery_securify_cache/helpers/mod.rs @@ -2,9 +2,6 @@ mod any_factor_derivation_request; mod any_factor_derivation_requests; mod derivation_analysis_types; mod factor_instances; -mod is_derivation_done_query; -mod on_chain_key_status_analyzer; -mod profile_key_status_analyzer; mod unindex_derivation_request; mod unindex_derivation_requests; @@ -12,8 +9,5 @@ pub use any_factor_derivation_request::*; pub use any_factor_derivation_requests::*; pub use derivation_analysis_types::*; pub use factor_instances::*; -pub use is_derivation_done_query::*; -pub use on_chain_key_status_analyzer::*; -pub use profile_key_status_analyzer::*; pub use unindex_derivation_request::*; pub use unindex_derivation_requests::*; diff --git a/src/recovery_securify_cache/helpers/on_chain_key_status_analyzer.rs b/src/recovery_securify_cache/helpers/on_chain_key_status_analyzer.rs deleted file mode 100644 index d40c98ab..00000000 --- a/src/recovery_securify_cache/helpers/on_chain_key_status_analyzer.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![allow(unused)] - -use crate::prelude::*; -#[derive(Default, Clone)] -pub struct OnChainKeyStatusAnalyzer { - gateway: Option>, -} -impl OnChainKeyStatusAnalyzer { - pub fn new(gateway: impl Into>>) -> Self { - Self { - gateway: gateway.into(), - } - } - - pub fn with_gateway(gateway: Arc) -> Self { - Self::new(gateway) - } - - pub fn dummy() -> Self { - Self::new(None) - } -} diff --git a/src/recovery_securify_cache/helpers/profile_key_status_analyzer.rs b/src/recovery_securify_cache/helpers/profile_key_status_analyzer.rs deleted file mode 100644 index 15cb86d7..00000000 --- a/src/recovery_securify_cache/helpers/profile_key_status_analyzer.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![allow(unused)] - -use crate::prelude::*; - -#[derive(Default, Clone)] -pub struct ProfileKeyStatusAnalyzer { - profile: Option>, -} -impl ProfileKeyStatusAnalyzer { - fn new(profile: impl Into>>) -> Self { - Self { - profile: profile.into(), - } - } - - pub fn with_profile(profile: Arc) -> Self { - Self::new(profile) - } - - pub fn dummy() -> Self { - Self::new(None) - } -}