diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d93adbca..38e6bd97c 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/crates/cdk-sqlite/src/wallet/migrations/20240810214105_mint_icon_url.sql b/crates/cdk-sqlite/src/wallet/migrations/20240810214105_mint_icon_url.sql index 8fcd64cbf..4b9983d15 100644 --- a/crates/cdk-sqlite/src/wallet/migrations/20240810214105_mint_icon_url.sql +++ b/crates/cdk-sqlite/src/wallet/migrations/20240810214105_mint_icon_url.sql @@ -1 +1 @@ -ALTER TABLE mint ADD mint_icon_url TEXT; \ No newline at end of file +ALTER TABLE mint ADD mint_icon_url TEXT; diff --git a/crates/cdk-sqlite/src/wallet/mod.rs b/crates/cdk-sqlite/src/wallet/mod.rs index 3552134a8..0441dcf07 100644 --- a/crates/cdk-sqlite/src/wallet/mod.rs +++ b/crates/cdk-sqlite/src/wallet/mod.rs @@ -65,35 +65,44 @@ impl WalletDatabase for WalletSqliteDatabase { mint_url: UncheckedUrl, mint_info: Option, ) -> 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#" diff --git a/crates/cdk/src/wallet/error.rs b/crates/cdk/src/wallet/error.rs index aa593b0a0..0c479d4e1 100644 --- a/crates/cdk/src/wallet/error.rs +++ b/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 {