Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit db1704a

Browse files
committed
Make NodeManager optional
1 parent c98f9f1 commit db1704a

File tree

6 files changed

+533
-349
lines changed

6 files changed

+533
-349
lines changed

mutiny-core/src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ pub enum MutinyError {
178178
/// Failed to connect to a federation.
179179
#[error("Failed to connect to a federation.")]
180180
FederationConnectionFailed,
181+
/// A node manager has not been created yet.
182+
#[error("A node manager has not been created yet.")]
183+
NodeManagerRequired,
181184
#[error(transparent)]
182185
Other(#[from] anyhow::Error),
183186
}
@@ -262,6 +265,7 @@ impl PartialEq for MutinyError {
262265
(Self::TokenAlreadySpent, Self::TokenAlreadySpent) => true,
263266
(Self::FederationRequired, Self::FederationRequired) => true,
264267
(Self::FederationConnectionFailed, Self::FederationConnectionFailed) => true,
268+
(Self::NodeManagerRequired, Self::NodeManagerRequired) => true,
265269
(Self::Other(e), Self::Other(e2)) => e.to_string() == e2.to_string(),
266270
_ => false,
267271
}

mutiny-core/src/labels.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::error::MutinyError;
2-
use crate::nodemanager::NodeManager;
32
use crate::storage::MutinyStorage;
3+
use crate::MutinyWallet;
44
use bitcoin::Address;
55
use lightning_invoice::Bolt11Invoice;
66
use lnurl::lightning_address::LightningAddress;
@@ -445,7 +445,7 @@ impl<S: MutinyStorage> LabelStorage for S {
445445
}
446446
}
447447

448-
impl<S: MutinyStorage> LabelStorage for NodeManager<S> {
448+
impl<S: MutinyStorage> LabelStorage for MutinyWallet<S> {
449449
fn get_address_labels(&self) -> Result<HashMap<String, Vec<String>>, MutinyError> {
450450
self.storage.get_address_labels()
451451
}

0 commit comments

Comments
 (0)