From 8ee5f62d62f5707789469c884a3237a780efbf00 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 29 Aug 2024 10:10:25 +0200 Subject: [PATCH] fix(cdk-lnbits): Strike -> LNbits, LNBits -> LNbits --- README.md | 2 +- crates/cdk-lnbits/src/error.rs | 4 ++-- crates/cdk-lnbits/src/lib.rs | 12 ++++++------ crates/cdk-mintd/src/config.rs | 8 ++++---- crates/cdk-mintd/src/main.rs | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d3105646..b01a1d8f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The project is split up into several crates in the `crates/` directory: * [**cdk-axum**](./crates/cdk-axum/): Axum webserver for mint. * [**cdk-cln**](./crates/cdk-cln/): CLN Lightning backend for mint. * [**cdk-strike**](./crates/cdk-strike/): Strike Lightning backend for mint. - * [**cdk-lnbits**](./crates/cdk-lnbits/): [LNBits](https://lnbits.com/) Lightning backend for mint. + * [**cdk-lnbits**](./crates/cdk-lnbits/): [LNbits](https://lnbits.com/) Lightning backend for mint. * [**cdk-fake-wallet**](./crates/cdk-fake-wallet/): Fake Lightning backend for mint. To be used only for testing, quotes are automatically filled. * Binaries: * [**cdk-cli**](./crates/cdk-cli/): Cashu wallet CLI. diff --git a/crates/cdk-lnbits/src/error.rs b/crates/cdk-lnbits/src/error.rs index 34dba31d..c968376d 100644 --- a/crates/cdk-lnbits/src/error.rs +++ b/crates/cdk-lnbits/src/error.rs @@ -1,8 +1,8 @@ -//! Error for Strike ln backend +//! Error for LNbits ln backend use thiserror::Error; -/// Strike Error +/// LNbits Error #[derive(Debug, Error)] pub enum Error { /// Invoice amount not defined diff --git a/crates/cdk-lnbits/src/lib.rs b/crates/cdk-lnbits/src/lib.rs index a5f75c7e..e8d9ee30 100644 --- a/crates/cdk-lnbits/src/lib.rs +++ b/crates/cdk-lnbits/src/lib.rs @@ -27,9 +27,9 @@ use tokio::sync::Mutex; pub mod error; -/// LNBits +/// LNbits #[derive(Clone)] -pub struct LNBits { +pub struct LNbits { lnbits_api: LNBitsClient, mint_settings: MintMeltSettings, melt_settings: MintMeltSettings, @@ -38,8 +38,8 @@ pub struct LNBits { webhook_url: String, } -impl LNBits { - /// Create new [`LNBits`] wallet +impl LNbits { + /// Create new [`LNbits`] wallet #[allow(clippy::too_many_arguments)] pub async fn new( admin_api_key: String, @@ -65,7 +65,7 @@ impl LNBits { } #[async_trait] -impl MintLightning for LNBits { +impl MintLightning for LNbits { type Err = cdk_lightning::Error; fn get_settings(&self) -> Settings { @@ -260,7 +260,7 @@ impl MintLightning for LNBits { } } -impl LNBits { +impl LNbits { /// Create invoice webhook pub async fn create_invoice_webhook_router( &self, diff --git a/crates/cdk-mintd/src/config.rs b/crates/cdk-mintd/src/config.rs index 951d15f5..37136d35 100644 --- a/crates/cdk-mintd/src/config.rs +++ b/crates/cdk-mintd/src/config.rs @@ -21,7 +21,7 @@ pub enum LnBackend { #[default] Cln, Strike, - LNBits, + LNbits, FakeWallet, // Greenlight, // Ldk, @@ -42,7 +42,7 @@ pub struct Strike { } #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct LNBits { +pub struct LNbits { pub admin_api_key: String, pub invoice_api_key: String, pub lnbits_api: String, @@ -86,7 +86,7 @@ pub struct Settings { pub ln: Ln, pub cln: Option, pub strike: Option, - pub lnbits: Option, + pub lnbits: Option, pub fake_wallet: Option, pub database: Database, } @@ -151,7 +151,7 @@ impl Settings { match settings.ln.ln_backend { LnBackend::Cln => assert!(settings.cln.is_some()), LnBackend::Strike => assert!(settings.strike.is_some()), - LnBackend::LNBits => assert!(settings.lnbits.is_some()), + LnBackend::LNbits => assert!(settings.lnbits.is_some()), LnBackend::FakeWallet => (), } diff --git a/crates/cdk-mintd/src/main.rs b/crates/cdk-mintd/src/main.rs index 114ffd92..f8aaff56 100644 --- a/crates/cdk-mintd/src/main.rs +++ b/crates/cdk-mintd/src/main.rs @@ -23,7 +23,7 @@ use cdk::nuts::{ use cdk_axum::LnKey; use cdk_cln::Cln; use cdk_fake_wallet::FakeWallet; -use cdk_lnbits::LNBits; +use cdk_lnbits::LNbits; use cdk_redb::MintRedbDatabase; use cdk_sqlite::MintSqliteDatabase; use cdk_strike::Strike; @@ -198,7 +198,7 @@ async fn main() -> anyhow::Result<()> { routers } - LnBackend::LNBits => { + LnBackend::LNbits => { let lnbits_settings = settings.lnbits.expect("Checked on config load"); let admin_api_key = lnbits_settings.admin_api_key; let invoice_api_key = lnbits_settings.invoice_api_key; @@ -209,7 +209,7 @@ async fn main() -> anyhow::Result<()> { let webhook_url = mint_url.join(webhook_endpoint)?; - let lnbits = LNBits::new( + let lnbits = LNbits::new( admin_api_key, invoice_api_key, lnbits_settings.lnbits_api,