Skip to content

Commit

Permalink
Make NodeManager optional
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed May 9, 2024
1 parent f6dd014 commit 2f77928
Show file tree
Hide file tree
Showing 7 changed files with 867 additions and 352 deletions.
4 changes: 4 additions & 0 deletions mutiny-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ pub enum MutinyError {
/// Failed to connect to a federation.
#[error("Failed to connect to a federation.")]
FederationConnectionFailed,
/// A node manager has not been created yet.
#[error("A node manager has not been created yet.")]
NodeManagerRequired,
#[error(transparent)]
Other(anyhow::Error),
}
Expand Down Expand Up @@ -263,6 +266,7 @@ impl PartialEq for MutinyError {
(Self::TokenAlreadySpent, Self::TokenAlreadySpent) => true,
(Self::FederationRequired, Self::FederationRequired) => true,
(Self::FederationConnectionFailed, Self::FederationConnectionFailed) => true,
(Self::NodeManagerRequired, Self::NodeManagerRequired) => true,
(Self::Other(e), Self::Other(e2)) => e.to_string() == e2.to_string(),
_ => false,
}
Expand Down
4 changes: 2 additions & 2 deletions mutiny-core/src/labels.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::error::MutinyError;
use crate::nodemanager::NodeManager;
use crate::storage::MutinyStorage;
use crate::MutinyWallet;
use bitcoin::Address;
use lightning_invoice::Bolt11Invoice;
use lnurl::lightning_address::LightningAddress;
Expand Down Expand Up @@ -445,7 +445,7 @@ impl<S: MutinyStorage> LabelStorage for S {
}
}

impl<S: MutinyStorage> LabelStorage for NodeManager<S> {
impl<S: MutinyStorage> LabelStorage for MutinyWallet<S> {
fn get_address_labels(&self) -> Result<HashMap<String, Vec<String>>, MutinyError> {
self.storage.get_address_labels()
}
Expand Down
Loading

0 comments on commit 2f77928

Please sign in to comment.