Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
chore: update cdk
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Jun 7, 2024
1 parent 53cdd08 commit 70a10d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ time = "0.3.22"
chrono = "0.4.26"
clap = { version = "4.3.14", features = ["env", "default", "derive"]}
anyhow = "1.0.71"
cdk = { git = "https://github.com/cashubtc/cdk", rev = "efd9b39", default-features = false, features = ["mint"] }
cdk-redb = { git = "https://github.com/cashubtc/cdk", rev = "efd9b39", default-features = false, features = ["mint"] }
cdk = { git = "https://github.com/cashubtc/cdk", rev = "267e5f0", default-features = false, features = ["mint"] }
cdk-redb = { git = "https://github.com/cashubtc/cdk", rev = "267e5f0", default-features = false, features = ["mint"] }
# cdk = { path = "../../cdk/nut14/crates/cdk", default-features = false, features = ["mint", "all-nuts"] }
# cdk-redb = { path = "../../cdk/nut14/crates/cdk-redb" }

Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use axum::routing::{get, post};
use axum::Router;
use bip39::Mnemonic;
use cdk::amount::Amount;
use cdk::cdk_database::MintDatabase;
use cdk::mint::Mint;
use cdk::nuts::nut02::Id;
use cdk::nuts::{
Expand Down Expand Up @@ -71,13 +70,12 @@ async fn main() -> anyhow::Result<()> {

let localstore = MintRedbDatabase::new(db_path.to_str().unwrap())?;
let mint_info = MintInfo::default();
//settings.mint_info.clone();
localstore.set_mint_info(&mint_info).await?;

let mnemonic = Mnemonic::from_str(&settings.info.mnemonic)?;

let mint = Mint::new(
&mnemonic.to_seed_normalized(""),
mint_info,
Arc::new(localstore),
Amount::ZERO,
0.0,
Expand Down Expand Up @@ -410,13 +408,7 @@ async fn post_check(

async fn get_mint_info(State(state): State<MintState>) -> Result<Json<MintInfo>, Response> {
Ok(Json(
state
.mint
.lock()
.await
.mint_info()
.await
.map_err(into_response)?,
state.mint.lock().await.mint_info().map_err(into_response)?,
))
}

Expand Down

0 comments on commit 70a10d8

Please sign in to comment.