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

Commit

Permalink
chore: use cashu-crab git dep
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Feb 3, 2024
1 parent f2ab3f8 commit dde7b2f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 34 deletions.
2 changes: 2 additions & 0 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"
# cashu-sdk = { git = "https://github.com/thesimplekid/cashu-crab", rev = "e06973a", default-features = false, features = ["mint", "all-nuts", "redb"] }
cashu-sdk = { path = "../cashu-crab/main/crates/cashu-sdk", default-features = false, features = ["mint", "all-nuts", "redb"] }
cashu-sdk = { git = "https://github.com/thesimplekid/cashu-crab", rev = "be2b51b", default-features = false, features = ["mint", "all-nuts", "redb"] }
# cashu-sdk = { path = "../cashu-crab/main/crates/cashu-sdk", default-features = false, features = ["mint", "all-nuts", "redb"] }
bitcoin = { version = "0.30.0", features = ["no-std"] }
serde = "1.0.164"
serde_json = "1.0.96"
Expand Down
13 changes: 0 additions & 13 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ pub struct ErrorResponse {
error: String,
}

impl ErrorResponse {
pub fn new(code: u16, error: &str) -> Self {
Self {
code,
error: error.to_string(),
}
}

pub fn as_json(&self) -> String {
serde_json::to_string(self).unwrap()
}
}

impl IntoResponse for Error {
fn into_response(self) -> Response {
match self {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async fn main() -> anyhow::Result<()> {
Ok(_) => (),
Err(_e) => {
// Create the parent directory if it doesn't exist
fs::create_dir_all(&last_pay_path.parent().unwrap())?;
fs::create_dir_all(last_pay_path.parent().unwrap())?;

// Attempt to create the file
let mut fs = File::create(&last_pay_path).unwrap();
Expand Down
18 changes: 0 additions & 18 deletions src/types.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
use anyhow::Result;
use cashu_sdk::nuts::nut02::Id;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KeysetInfo {
pub id: Id,
pub valid_from: u64,
pub valid_to: Option<u64>,
pub secret: String,
pub derivation_path: String,
pub max_order: u8,
}

impl KeysetInfo {
pub fn as_json(&self) -> Result<String> {
Ok(serde_json::to_string(self)?)
}
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum LnMessage {
PaymentReceived,
Expand Down

0 comments on commit dde7b2f

Please sign in to comment.