feat: remove features from auth (#1103)

This commit is contained in:
thesimplekid
2025-09-23 09:27:07 +01:00
committed by GitHub
parent c1e35f964b
commit 6b80b74cb1
4 changed files with 2 additions and 17 deletions

View File

@@ -120,9 +120,6 @@ jobs:
# FFI bindings
-p cdk-ffi,
-p cdk-ffi --no-default-features,
-p cdk-ffi --no-default-features --features auth,
-p cdk-ffi --no-default-features --features bip353,
# Binaries
--bin cdk-cli,

View File

@@ -10,15 +10,10 @@ rust-version.workspace = true
crate-type = ["cdylib", "staticlib", "rlib"]
name = "cdk_ffi"
[features]
default = ["auth", "bip353"]
auth = ["cdk/auth"]
bip353 = ["cdk/bip353"]
[dependencies]
async-trait = { workspace = true }
bip39 = { workspace = true }
cdk = { workspace = true, default-features = false, features = ["wallet"] }
cdk = { workspace = true, default-features = false, features = ["wallet", "auth", "bip353"] }
cdk-sqlite = { workspace = true }
ctor = "0.2"
futures = { workspace = true }

View File

@@ -1998,7 +1998,6 @@ impl TryFrom<TransactionId> for cdk::wallet::types::TransactionId {
}
/// FFI-compatible AuthProof
#[cfg(feature = "auth")]
#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
pub struct AuthProof {
/// Keyset ID
@@ -2011,7 +2010,6 @@ pub struct AuthProof {
pub y: String,
}
#[cfg(feature = "auth")]
impl From<cdk::nuts::AuthProof> for AuthProof {
fn from(auth_proof: cdk::nuts::AuthProof) -> Self {
Self {
@@ -2026,7 +2024,6 @@ impl From<cdk::nuts::AuthProof> for AuthProof {
}
}
#[cfg(feature = "auth")]
impl TryFrom<AuthProof> for cdk::nuts::AuthProof {
type Error = FfiError;
@@ -2047,7 +2044,6 @@ impl TryFrom<AuthProof> for cdk::nuts::AuthProof {
}
}
#[cfg(feature = "auth")]
impl AuthProof {
/// Convert AuthProof to JSON string
pub fn to_json(&self) -> Result<String, FfiError> {
@@ -2056,14 +2052,12 @@ impl AuthProof {
}
/// Decode AuthProof from JSON string
#[cfg(feature = "auth")]
#[uniffi::export]
pub fn decode_auth_proof(json: String) -> Result<AuthProof, FfiError> {
Ok(serde_json::from_str(&json)?)
}
/// Encode AuthProof to JSON string
#[cfg(feature = "auth")]
#[uniffi::export]
pub fn encode_auth_proof(proof: AuthProof) -> Result<String, FfiError> {
Ok(serde_json::to_string(&proof)?)

View File

@@ -404,7 +404,7 @@ impl Wallet {
}
/// BIP353 methods for Wallet
#[cfg(all(feature = "bip353", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
#[uniffi::export(async_runtime = "tokio")]
impl Wallet {
/// Get a quote for a BIP353 melt
@@ -426,7 +426,6 @@ impl Wallet {
}
/// Auth methods for Wallet
#[cfg(feature = "auth")]
#[uniffi::export(async_runtime = "tokio")]
impl Wallet {
/// Set Clear Auth Token (CAT) for authentication