Skip to content

Commit

Permalink
Rename cdk-common to cashu, as suggested by @thesimplekid
Browse files Browse the repository at this point in the history
  • Loading branch information
crodas committed Jan 6, 2025
1 parent 2073ebc commit 1b95398
Show file tree
Hide file tree
Showing 70 changed files with 121 additions and 121 deletions.
58 changes: 29 additions & 29 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions crates/cdk-common/Cargo.toml → crates/cashu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "cdk-common"
name = "cashu"
version = "0.6.0"
edition = "2021"
description = "CDK shared types and crypto utilities"
rust-version = "1.63.0" # MSRV
description = "Cashu shared types and crypto utilities, used as the foundation for the CDK and their crates"
rust-version = "1.63.0" # MSRV

[features]
swagger = ["dep:utoipa"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/cdk-common/src/lib.rs → crates/cashu/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! CDK shared types and functions.
//! Cashu shared types and functions.
//!
//! This crate is the base foundation to build things that can interact with the CDK (Cashu
//! Development Kit) and their internal crates.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/cdk-redb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ wallet = []

[dependencies]
async-trait = "0.1"
cdk-common = { path = "../cdk-common", version = "0.6.0", default-features = false }
cashu = { path = "../cashu", version = "0.6.0", default-features = false }
redb = "2.1.0"
thiserror = "1"
tracing = { version = "0.1", default-features = false, features = [
Expand Down
14 changes: 7 additions & 7 deletions crates/cdk-redb/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ pub enum Error {
ParseInt(#[from] ParseIntError),
/// CDK Database Error
#[error(transparent)]
CDKDatabase(#[from] cdk_common::database::Error),
CDKDatabase(#[from] cashu::database::Error),
/// CDK Mint Url Error
#[error(transparent)]
CDKMintUrl(#[from] cdk_common::mint_url::Error),
CDKMintUrl(#[from] cashu::mint_url::Error),
/// CDK Error
#[error(transparent)]
CDK(#[from] cdk_common::error::Error),
CDK(#[from] cashu::error::Error),
/// NUT00 Error
#[error(transparent)]
CDKNUT00(#[from] cdk_common::nuts::nut00::Error),
CDKNUT00(#[from] cashu::nuts::nut00::Error),
/// NUT02 Error
#[error(transparent)]
CDKNUT02(#[from] cdk_common::nuts::nut02::Error),
CDKNUT02(#[from] cashu::nuts::nut02::Error),
/// DHKE Error
#[error(transparent)]
DHKE(#[from] cdk_common::dhke::Error),
DHKE(#[from] cashu::dhke::Error),
/// Unknown Mint Info
#[error("Unknown mint info")]
UnknownMintInfo,
Expand All @@ -60,7 +60,7 @@ pub enum Error {
UnknownDatabaseVersion,
}

impl From<Error> for cdk_common::database::Error {
impl From<Error> for cashu::database::Error {
fn from(e: Error) -> Self {
Self::Database(Box::new(e))
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cdk-redb/src/migrations.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;
use std::sync::Arc;

use cdk_common::mint_url::MintUrl;
use cdk_common::{Amount, CurrencyUnit, MeltQuoteState, MintQuoteState};
use cashu::mint_url::MintUrl;
use cashu::{Amount, CurrencyUnit, MeltQuoteState, MintQuoteState};
use redb::{Database, ReadableTable, TableDefinition};
use serde::{Deserialize, Serialize};

Expand Down
6 changes: 3 additions & 3 deletions crates/cdk-redb/src/mint/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::collections::HashMap;
use std::str::FromStr;
use std::sync::Arc;

use cdk_common::mint::MintQuote;
use cdk_common::mint_url::MintUrl;
use cdk_common::{Amount, CurrencyUnit, MintQuoteState, Proof, State};
use cashu::mint::MintQuote;
use cashu::mint_url::MintUrl;
use cashu::{Amount, CurrencyUnit, MintQuoteState, Proof, State};
use lightning_invoice::Bolt11Invoice;
use redb::{
Database, MultimapTableDefinition, ReadableMultimapTable, ReadableTable, TableDefinition,
Expand Down
12 changes: 6 additions & 6 deletions crates/cdk-redb/src/mint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use std::str::FromStr;
use std::sync::Arc;

use async_trait::async_trait;
use cdk_common::common::LnKey;
use cdk_common::database::{self, MintDatabase};
use cdk_common::dhke::hash_to_curve;
use cdk_common::mint::{self, MintKeySetInfo, MintQuote};
use cdk_common::nut00::ProofsMethods;
use cdk_common::{
use cashu::common::LnKey;
use cashu::database::{self, MintDatabase};
use cashu::dhke::hash_to_curve;
use cashu::mint::{self, MintKeySetInfo, MintQuote};
use cashu::nut00::ProofsMethods;
use cashu::{
BlindSignature, CurrencyUnit, Id, MeltBolt11Request, MeltQuoteState, MintQuoteState, Proof,
Proofs, PublicKey, State,
};
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-redb/src/wallet/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Deref;
use std::str::FromStr;
use std::sync::Arc;

use cdk_common::mint_url::MintUrl;
use cashu::mint_url::MintUrl;
use redb::{
Database, MultimapTableDefinition, ReadableMultimapTable, ReadableTable, TableDefinition,
};
Expand Down
12 changes: 6 additions & 6 deletions crates/cdk-redb/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use std::str::FromStr;
use std::sync::Arc;

use async_trait::async_trait;
use cdk_common::common::ProofInfo;
use cdk_common::database::WalletDatabase;
use cdk_common::mint_url::MintUrl;
use cdk_common::util::unix_time;
use cdk_common::wallet::{self, MintQuote};
use cdk_common::{
use cashu::common::ProofInfo;
use cashu::database::WalletDatabase;
use cashu::mint_url::MintUrl;
use cashu::util::unix_time;
use cashu::wallet::{self, MintQuote};
use cashu::{
database, CurrencyUnit, Id, KeySetInfo, Keys, MintInfo, PublicKey, SpendingConditions, State,
};
use redb::{Database, MultimapTableDefinition, ReadableTable, TableDefinition};
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ wallet = []

[dependencies]
async-trait = "0.1"
cdk-common = { path = "../cdk-common", version = "0.6.0", default-features = false }
cashu = { path = "../cashu", version = "0.6.0", default-features = false }
bitcoin = { version = "0.32.2", default-features = false }
sqlx = { version = "0.6.3", default-features = false, features = [
"runtime-tokio-rustls",
Expand Down
18 changes: 9 additions & 9 deletions crates/cdk-sqlite/src/mint/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ pub enum Error {
SQLX(#[from] sqlx::Error),
/// NUT00 Error
#[error(transparent)]
CDKNUT00(#[from] cdk_common::nuts::nut00::Error),
CDKNUT00(#[from] cashu::nuts::nut00::Error),
/// NUT01 Error
#[error(transparent)]
CDKNUT01(#[from] cdk_common::nuts::nut01::Error),
CDKNUT01(#[from] cashu::nuts::nut01::Error),
/// NUT02 Error
#[error(transparent)]
CDKNUT02(#[from] cdk_common::nuts::nut02::Error),
CDKNUT02(#[from] cashu::nuts::nut02::Error),
/// NUT04 Error
#[error(transparent)]
CDKNUT04(#[from] cdk_common::nuts::nut04::Error),
CDKNUT04(#[from] cashu::nuts::nut04::Error),
/// NUT05 Error
#[error(transparent)]
CDKNUT05(#[from] cdk_common::nuts::nut05::Error),
CDKNUT05(#[from] cashu::nuts::nut05::Error),
/// NUT07 Error
#[error(transparent)]
CDKNUT07(#[from] cdk_common::nuts::nut07::Error),
CDKNUT07(#[from] cashu::nuts::nut07::Error),
/// Secret Error
#[error(transparent)]
CDKSECRET(#[from] cdk_common::secret::Error),
CDKSECRET(#[from] cashu::secret::Error),
/// BIP32 Error
#[error(transparent)]
BIP32(#[from] bitcoin::bip32::Error),
/// Mint Url Error
#[error(transparent)]
MintUrl(#[from] cdk_common::mint_url::Error),
MintUrl(#[from] cashu::mint_url::Error),
/// Could Not Initialize Database
#[error("Could not initialize database")]
CouldNotInitialize,
Expand All @@ -46,7 +46,7 @@ pub enum Error {
Serde(#[from] serde_json::Error),
}

impl From<Error> for cdk_common::database::Error {
impl From<Error> for cashu::database::Error {
fn from(e: Error) -> Self {
Self::Database(Box::new(e))
}
Expand Down
16 changes: 8 additions & 8 deletions crates/cdk-sqlite/src/mint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ use std::time::Duration;

use async_trait::async_trait;
use bitcoin::bip32::DerivationPath;
use cdk_common::common::LnKey;
use cdk_common::database::{self, MintDatabase};
use cdk_common::mint::{self, MintKeySetInfo, MintQuote};
use cdk_common::mint_url::MintUrl;
use cdk_common::nut00::ProofsMethods;
use cdk_common::nut05::QuoteState;
use cdk_common::secret::Secret;
use cdk_common::{
use cashu::common::LnKey;
use cashu::database::{self, MintDatabase};
use cashu::mint::{self, MintKeySetInfo, MintQuote};
use cashu::mint_url::MintUrl;
use cashu::nut00::ProofsMethods;
use cashu::nut05::QuoteState;
use cashu::secret::Secret;
use cashu::{
Amount, BlindSignature, BlindSignatureDleq, CurrencyUnit, Id, MeltBolt11Request,
MeltQuoteState, MintQuoteState, PaymentMethod, Proof, Proofs, PublicKey, SecretKey, State,
};
Expand Down
18 changes: 9 additions & 9 deletions crates/cdk-sqlite/src/wallet/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ pub enum Error {
Serde(#[from] serde_json::Error),
/// NUT00 Error
#[error(transparent)]
CDKNUT00(#[from] cdk_common::nuts::nut00::Error),
CDKNUT00(#[from] cashu::nuts::nut00::Error),
/// NUT01 Error
#[error(transparent)]
CDKNUT01(#[from] cdk_common::nuts::nut01::Error),
CDKNUT01(#[from] cashu::nuts::nut01::Error),
/// NUT02 Error
#[error(transparent)]
CDKNUT02(#[from] cdk_common::nuts::nut02::Error),
CDKNUT02(#[from] cashu::nuts::nut02::Error),
/// NUT04 Error
#[error(transparent)]
CDKNUT04(#[from] cdk_common::nuts::nut04::Error),
CDKNUT04(#[from] cashu::nuts::nut04::Error),
/// NUT05 Error
#[error(transparent)]
CDKNUT05(#[from] cdk_common::nuts::nut05::Error),
CDKNUT05(#[from] cashu::nuts::nut05::Error),
/// NUT07 Error
#[error(transparent)]
CDKNUT07(#[from] cdk_common::nuts::nut07::Error),
CDKNUT07(#[from] cashu::nuts::nut07::Error),
/// Secret Error
#[error(transparent)]
CDKSECRET(#[from] cdk_common::secret::Error),
CDKSECRET(#[from] cashu::secret::Error),
/// Mint Url
#[error(transparent)]
MintUrl(#[from] cdk_common::mint_url::Error),
MintUrl(#[from] cashu::mint_url::Error),
/// BIP32 Error
#[error(transparent)]
BIP32(#[from] bitcoin::bip32::Error),
Expand All @@ -46,7 +46,7 @@ pub enum Error {
InvalidDbPath,
}

impl From<Error> for cdk_common::database::Error {
impl From<Error> for cashu::database::Error {
fn from(e: Error) -> Self {
Self::Database(Box::new(e))
}
Expand Down
14 changes: 7 additions & 7 deletions crates/cdk-sqlite/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use std::path::Path;
use std::str::FromStr;

use async_trait::async_trait;
use cdk_common::common::ProofInfo;
use cdk_common::database::WalletDatabase;
use cdk_common::mint_url::MintUrl;
use cdk_common::nuts::{MeltQuoteState, MintQuoteState};
use cdk_common::secret::Secret;
use cdk_common::wallet::{self, MintQuote};
use cdk_common::{
use cashu::common::ProofInfo;
use cashu::database::WalletDatabase;
use cashu::mint_url::MintUrl;
use cashu::nuts::{MeltQuoteState, MintQuoteState};
use cashu::secret::Secret;
use cashu::wallet::{self, MintQuote};
use cashu::{
database, Amount, CurrencyUnit, Id, KeySetInfo, Keys, MintInfo, Proof, PublicKey, SecretKey,
SpendingConditions, State,
};
Expand Down
4 changes: 2 additions & 2 deletions crates/cdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ license = "MIT"
default = ["mint", "wallet"]
mint = ["dep:futures"]
# We do not commit to a MSRV with swagger enabled
swagger = ["mint", "dep:utoipa", "cdk-common/swagger"]
swagger = ["mint", "dep:utoipa", "cashu/swagger"]
wallet = ["dep:reqwest"]
bench = []
http_subscription = []


[dependencies]
cdk-common = { path = "../cdk-common", version = "0.6.0", default-features = false }
cashu = { path = "../cashu", version = "0.6.0", default-features = false }
cbor-diag = "0.1.12"
arc-swap = "1.7.1"
async-trait = "0.1"
Expand Down
Loading

0 comments on commit 1b95398

Please sign in to comment.