Browse Source

chore: fix formatting

thesimplekid 8 tháng trước cách đây
mục cha
commit
e57c7f1e9d

+ 2 - 0
CHANGELOG.md

@@ -50,6 +50,7 @@
 - cdk(cdk-database/mint): Add `get_blinded_signatures_for_keyset` to get all blind signatures for a `keyset_id` ([thesimplekid]).
 - cdk(mint): Add `total_issued` and `total_redeamed` ([thesimplekid]).
 - cdk(cdk-database/mint) Add `get_proofs_by_keyset_id` ([thesimplekid]).
+- cdk(wallet/mint): Add `mint_icon_url` ([cjbeery24])
 
 ### Fixed
 - cdk(mint): `SIG_ALL` is not allowed in `melt` ([thesimplekid]).
@@ -109,3 +110,4 @@ Additionally, this release introduces a Mint binary cdk-mintd that uses the cdk-
 [thesimplekid]: https://github.com/thesimplekid
 [davidcaseria]: https://github.com/davidcaseria
 [vnprc]: https://github.com/vnprc
+[cjberry24]: https://github.com/cjbeery24

+ 1 - 1
crates/cdk-sqlite/src/wallet/migrations/20240810214105_mint_icon_url.sql

@@ -1 +1 @@
-ALTER TABLE mint ADD mint_icon_url TEXT;
+ALTER TABLE mint ADD mint_icon_url TEXT;

+ 38 - 29
crates/cdk-sqlite/src/wallet/mod.rs

@@ -65,35 +65,44 @@ impl WalletDatabase for WalletSqliteDatabase {
         mint_url: UncheckedUrl,
         mint_info: Option<MintInfo>,
     ) -> Result<(), Self::Err> {
-        let (name, pubkey, version, description, description_long, contact, nuts, mint_icon_url, motd) =
-            match mint_info {
-                Some(mint_info) => {
-                    let MintInfo {
-                        name,
-                        pubkey,
-                        version,
-                        description,
-                        description_long,
-                        contact,
-                        nuts,
-                        mint_icon_url,
-                        motd,
-                    } = mint_info;
-
-                    (
-                        name,
-                        pubkey.map(|p| p.to_bytes().to_vec()),
-                        version.map(|v| serde_json::to_string(&v).ok()),
-                        description,
-                        description_long,
-                        contact.map(|c| serde_json::to_string(&c).ok()),
-                        serde_json::to_string(&nuts).ok(),
-                        mint_icon_url,
-                        motd,
-                    )
-                }
-                None => (None, None, None, None, None, None, None, None, None),
-            };
+        let (
+            name,
+            pubkey,
+            version,
+            description,
+            description_long,
+            contact,
+            nuts,
+            mint_icon_url,
+            motd,
+        ) = match mint_info {
+            Some(mint_info) => {
+                let MintInfo {
+                    name,
+                    pubkey,
+                    version,
+                    description,
+                    description_long,
+                    contact,
+                    nuts,
+                    mint_icon_url,
+                    motd,
+                } = mint_info;
+
+                (
+                    name,
+                    pubkey.map(|p| p.to_bytes().to_vec()),
+                    version.map(|v| serde_json::to_string(&v).ok()),
+                    description,
+                    description_long,
+                    contact.map(|c| serde_json::to_string(&c).ok()),
+                    serde_json::to_string(&nuts).ok(),
+                    mint_icon_url,
+                    motd,
+                )
+            }
+            None => (None, None, None, None, None, None, None, None, None),
+        };
 
         sqlx::query(
             r#"

+ 1 - 2
crates/cdk/src/wallet/error.rs

@@ -4,11 +4,10 @@ use std::num::ParseIntError;
 
 use thiserror::Error;
 
+use super::multi_mint_wallet::WalletKey;
 use crate::cdk_database;
 use crate::error::{ErrorCode, ErrorResponse};
 
-use super::multi_mint_wallet::WalletKey;
-
 /// Wallet Error
 #[derive(Debug, Error)]
 pub enum Error {