mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-24 08:05:02 +01:00
chore: Update rust-version (MSRV) to 1.75.0 (#623)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "cdk-common"
|
||||
version = "0.7.1"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "CDK common types and traits"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
license = "MIT"
|
||||
edition.workspace = true
|
||||
rust-version = "1.75.0" # MSRV
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
default = ["mint", "wallet"]
|
||||
@@ -17,31 +17,26 @@ wallet = ["cashu/wallet"]
|
||||
mint = ["cashu/mint", "dep:uuid"]
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
bitcoin = { version = "0.32.2", features = [
|
||||
"base64",
|
||||
"serde",
|
||||
"rand",
|
||||
"rand-std",
|
||||
] }
|
||||
cashu = { path = "../cashu", default-features = false, version = "0.7.1" }
|
||||
cbor-diag = "0.1.12"
|
||||
ciborium = { version = "0.2.2", default-features = false, features = ["std"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
lightning-invoice = { version = "0.32.0", features = ["serde", "std"] }
|
||||
thiserror = "2"
|
||||
tracing = "0.1"
|
||||
url = "2.3"
|
||||
uuid = { version = "=1.12.1", features = ["v4", "serde"], optional = true }
|
||||
utoipa = { version = "4", optional = true }
|
||||
futures = "0.3.31"
|
||||
anyhow = "1.0"
|
||||
serde_json = "1"
|
||||
serde_with = "3"
|
||||
async-trait.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cashu.workspace = true
|
||||
cbor-diag.workspace = true
|
||||
ciborium.workspace = true
|
||||
serde.workspace = true
|
||||
lightning-invoice.workspace = true
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
url.workspace = true
|
||||
uuid = { workspace = true, optional = true }
|
||||
utoipa = { workspace = true, optional = true }
|
||||
futures.workspace = true
|
||||
anyhow.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_with.workspace = true
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] }
|
||||
instant = { workspace = true, features = ["wasm-bindgen", "inaccurate"] }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.8.5"
|
||||
bip39 = "2.0"
|
||||
rand.workspace = true
|
||||
bip39.workspace = true
|
||||
|
||||
@@ -12,7 +12,6 @@ pub mod error;
|
||||
#[cfg(feature = "mint")]
|
||||
pub mod lightning;
|
||||
pub mod pub_sub;
|
||||
#[cfg(feature = "mint")]
|
||||
pub mod subscription;
|
||||
pub mod ws;
|
||||
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
//! Subscription types and traits
|
||||
#[cfg(feature = "mint")]
|
||||
use std::str::FromStr;
|
||||
|
||||
use cashu::nut17::{self, Error, Kind, Notification};
|
||||
use cashu::nut17::{self};
|
||||
#[cfg(feature = "mint")]
|
||||
use cashu::nut17::{Error, Kind, Notification};
|
||||
#[cfg(feature = "mint")]
|
||||
use cashu::{NotificationPayload, PublicKey};
|
||||
#[cfg(feature = "mint")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[cfg(feature = "mint")]
|
||||
use uuid::Uuid;
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
use crate::pub_sub::index::{Index, Indexable, SubscriptionGlobalId};
|
||||
use crate::pub_sub::SubId;
|
||||
|
||||
@@ -15,15 +22,18 @@ use crate::pub_sub::SubId;
|
||||
pub type Params = nut17::Params<SubId>;
|
||||
|
||||
/// Wrapper around `nut17::Params` to implement `Indexable` for `Notification`.
|
||||
#[cfg(feature = "mint")]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct IndexableParams(Params);
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
impl From<Params> for IndexableParams {
|
||||
fn from(params: Params) -> Self {
|
||||
Self(params)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
impl TryFrom<IndexableParams> for Vec<Index<Notification>> {
|
||||
type Error = Error;
|
||||
fn try_from(params: IndexableParams) -> Result<Self, Self::Error> {
|
||||
@@ -49,12 +59,14 @@ impl TryFrom<IndexableParams> for Vec<Index<Notification>> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
impl AsRef<SubId> for IndexableParams {
|
||||
fn as_ref(&self) -> &SubId {
|
||||
&self.0.id
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
impl Indexable for NotificationPayload<Uuid> {
|
||||
type Type = Notification;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user