diff --git a/cli/src/modules/mod.rs b/cli/src/modules/mod.rs index 5909fc340..849c26fa6 100644 --- a/cli/src/modules/mod.rs +++ b/cli/src/modules/mod.rs @@ -18,7 +18,6 @@ pub mod help; pub mod history; pub mod import; pub mod list; -// pub mod metrics; pub mod message; pub mod miner; pub mod monitor; @@ -43,6 +42,10 @@ pub mod track; pub mod transfer; pub mod wallet; +// this module is registered manually within +// applications that support metrics +pub mod metrics; + // TODO // broadcast // create-unsigned-tx diff --git a/kos/src/metrics/ipc.rs b/kos/src/metrics/ipc.rs index c78464e4a..2e921371a 100644 --- a/kos/src/metrics/ipc.rs +++ b/kos/src/metrics/ipc.rs @@ -1,5 +1,5 @@ use crate::imports::*; -use kaspa_cli_lib::metrics::MetricsSnapshot; +use kaspa_metrics::MetricsSnapshot; #[derive(Debug, Clone, PartialEq, Eq, Hash, BorshDeserialize, BorshSerialize, Serialize, Deserialize)] pub enum MetricsOps { diff --git a/kos/src/metrics/metrics.rs b/kos/src/metrics/metrics.rs index b68d43f02..88c33ae8b 100644 --- a/kos/src/metrics/metrics.rs +++ b/kos/src/metrics/metrics.rs @@ -1,6 +1,6 @@ use super::toolbar::*; use crate::imports::*; -use kaspa_cli_lib::metrics::{Metric, MetricsSnapshot}; +use kaspa_metrics::{Metric, MetricsSnapshot}; use std::collections::HashMap; use workflow_core::time::{HOURS, MINUTES}; use workflow_d3::container::*; diff --git a/kos/src/metrics/toolbar.rs b/kos/src/metrics/toolbar.rs index be8062b17..2d85bec48 100644 --- a/kos/src/metrics/toolbar.rs +++ b/kos/src/metrics/toolbar.rs @@ -4,7 +4,7 @@ use crate::imports::*; use crate::result::Result; use std::{collections::HashMap, sync::MutexGuard}; -use kaspa_cli_lib::metrics::Metric; +use kaspa_metrics::Metric; use web_sys::{Document, Element, MouseEvent}; use workflow_d3::graph::GraphDuration; #[allow(unused_imports)] diff --git a/kos/src/modules/metrics.rs b/kos/src/modules/metrics.rs index b60bf7e42..527dea2a8 100644 --- a/kos/src/modules/metrics.rs +++ b/kos/src/modules/metrics.rs @@ -1,5 +1,6 @@ use crate::imports::*; -use kaspa_cli_lib::metrics::{metrics::MetricsSinkFn, Metrics as Inner}; +use kaspa_cli_lib::modules::metrics::Metrics as Inner; +use kaspa_metrics::MetricsSinkFn; pub struct Metrics { inner: Arc, diff --git a/kos/src/terminal/terminal.rs b/kos/src/terminal/terminal.rs index 23abb5ca0..3b2c99f0e 100644 --- a/kos/src/terminal/terminal.rs +++ b/kos/src/terminal/terminal.rs @@ -1,5 +1,5 @@ use crate::imports::*; -use kaspa_cli_lib::metrics::MetricsSnapshot; +use kaspa_metrics::MetricsSnapshot; static mut TERMINAL: Option> = None; static mut SHUTDOWN_ATTEMPTS: usize = 0; diff --git a/wallet/core/src/runtime/account/variants/keypair.rs b/wallet/core/src/runtime/account/variants/keypair.rs index 7b687aa06..fa62cf2e9 100644 --- a/wallet/core/src/runtime/account/variants/keypair.rs +++ b/wallet/core/src/runtime/account/variants/keypair.rs @@ -26,7 +26,7 @@ impl Keypair { let inner = Arc::new(Inner::new(wallet, id, Some(settings))); let storage::account::Keypair { public_key, ecdsa, .. } = data; - Ok(Self { inner, prv_key_data_id, public_key, ecdsa }) + Ok(Self { inner, prv_key_data_id, public_key: PublicKey::from_str(public_key.as_str())?, ecdsa }) } } diff --git a/wallet/core/src/runtime/wallet.rs b/wallet/core/src/runtime/wallet.rs index 9113d4e28..6b4813770 100644 --- a/wallet/core/src/runtime/wallet.rs +++ b/wallet/core/src/runtime/wallet.rs @@ -261,7 +261,7 @@ impl Wallet { } /// Loads a wallet from storage. Accounts are not activated by this call. - async fn load_impl(self: &Arc, secret: Secret, name: Option) -> Result<()> { + async fn load_impl(self: &Arc, wallet_secret: Secret, name: Option) -> Result<()> { self.reset().await?; let name = name.or_else(|| self.settings().get(WalletSettings::Wallet)); @@ -276,8 +276,8 @@ impl Wallet { } /// Loads a wallet from storage. Accounts are not activated by this call. - pub async fn load(self: &Arc, secret: Secret, name: Option) -> Result<()> { - if let Err(err) = self.load_impl(secret, name).await { + pub async fn load(self: &Arc, wallet_secret: Secret, name: Option) -> Result<()> { + if let Err(err) = self.load_impl(wallet_secret, name).await { self.notify(Events::WalletError { message: err.to_string() }).await?; Err(err) } else {