Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Aug 11, 2024
1 parent da1acc4 commit e57c7f1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 32 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE mint ADD mint_icon_url TEXT;
ALTER TABLE mint ADD mint_icon_url TEXT;
67 changes: 38 additions & 29 deletions crates/cdk-sqlite/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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#"
Expand Down
3 changes: 1 addition & 2 deletions crates/cdk/src/wallet/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e57c7f1

Please sign in to comment.