Skip to content

Commit

Permalink
Make NodeManager optional
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Apr 16, 2024
1 parent 3615aac commit f3aece1
Show file tree
Hide file tree
Showing 7 changed files with 546 additions and 361 deletions.
4 changes: 4 additions & 0 deletions mutiny-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,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(#[from] anyhow::Error),
}
Expand Down Expand Up @@ -262,6 +265,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 f3aece1

Please sign in to comment.