Skip to content

Commit bb7cc4b

Browse files
committed
ldk 0.2.0-rc1
1 parent fbdd942 commit bb7cc4b

4 files changed

Lines changed: 41 additions & 23 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ panic = 'abort' # Abort on panic
1717

1818
[workspace.dependencies]
1919
bitcoin-payment-instructions = { git = "https://github.com/benthecarman/bitcoin-payment-instructions.git", branch = "orange-fork2", features = ["http"] }
20-
lightning = { version = "0.2.0-beta1" }
21-
lightning-invoice = { version = "0.34.0-beta1" }
20+
lightning = { version = "0.2.0-rc1" }
21+
lightning-invoice = { version = "0.34.0-rc1" }
2222

2323
[profile.release]
2424
panic = "abort"

orange-sdk/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _cashu-tests = ["_test-utils", "cdk-ldk-node", "cdk/mint", "cdk-sqlite", "cdk-ax
2323
[dependencies]
2424
graduated-rebalancer = { path = "../graduated-rebalancer", version = "0.1.0" }
2525

26-
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node.git", rev = "6d91eabcb11bf3b32f0a2e5f43b55c98d84ba1f0" }
26+
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node.git", rev = "870521446700353ff6461da98bd6e2c2318a9930" }
2727
lightning-macros = "0.2.0-beta1"
2828
bitcoin-payment-instructions = { workspace = true }
2929
chrono = { version = "0.4", default-features = false }
@@ -32,15 +32,15 @@ reqwest = { version = "0.12.23", default-features = false, features = ["rustls-t
3232
breez-sdk-spark = { git = "https://github.com/breez/spark-sdk.git", rev = "1f2e9995230cd582d6b4aa7d06d76b99defb635e", default-features = false, features = ["rustls-tls"], optional = true }
3333
tokio = { version = "1.0", default-features = false, features = ["rt-multi-thread", "sync"] }
3434
uuid = { version = "1.0", default-features = false, optional = true }
35-
cdk = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", default-features = false, features = ["wallet"], optional = true }
35+
cdk = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", default-features = false, features = ["wallet"], optional = true }
3636
serde_json = { version = "1.0", optional = true }
3737
async-trait = "0.1"
3838
log = "0.4.28"
3939

4040
corepc-node = { version = "0.8.0", features = ["29_0", "download"], optional = true }
41-
cdk-ldk-node = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
42-
cdk-sqlite = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
43-
cdk-axum = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
41+
cdk-ldk-node = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
42+
cdk-sqlite = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
43+
cdk-axum = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
4444
axum = { version = "0.8.1", optional = true }
4545

4646
uniffi = { version = "0.29", features = ["cli", "tokio"], optional = true }

orange-sdk/src/trusted_wallet/cashu/cashu_store.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -309,21 +309,27 @@ impl WalletDatabase for CashuKvDatabase {
309309
let mint_key = Self::generate_mint_key(&mint_url);
310310

311311
// Remove mint URL by writing empty data
312-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINTS_KEY, &mint_key)
312+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINTS_KEY, &mint_key, false)
313313
.await
314314
.map_err(DatabaseError::Io)?;
315315

316316
// Remove mint info
317317
let info_key = Self::generate_mint_info_key(&mint_url);
318-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINTS_KEY, &info_key)
318+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINTS_KEY, &info_key, false)
319319
.await
320320
.map_err(DatabaseError::Io)?;
321321

322322
// Remove mint keysets
323323
let keysets_key = Self::generate_mint_keysets_key(&mint_url);
324-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINT_KEYSETS_KEY, &keysets_key)
325-
.await
326-
.map_err(DatabaseError::Io)?;
324+
KVStore::remove(
325+
self.store.as_ref(),
326+
CASHU_PRIMARY_KEY,
327+
MINT_KEYSETS_KEY,
328+
&keysets_key,
329+
false,
330+
)
331+
.await
332+
.map_err(DatabaseError::Io)?;
327333

328334
// Update cache
329335
{
@@ -580,7 +586,7 @@ impl WalletDatabase for CashuKvDatabase {
580586

581587
async fn remove_mint_quote(&self, quote_id: &str) -> Result<(), Self::Err> {
582588
// Mark as removed by writing empty data
583-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINT_QUOTES_KEY, quote_id)
589+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MINT_QUOTES_KEY, quote_id, false)
584590
.await
585591
.map_err(DatabaseError::Io)?;
586592

@@ -637,7 +643,7 @@ impl WalletDatabase for CashuKvDatabase {
637643
}
638644

639645
async fn remove_melt_quote(&self, quote_id: &str) -> Result<(), Self::Err> {
640-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MELT_QUOTES_KEY, quote_id)
646+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, MELT_QUOTES_KEY, quote_id, false)
641647
.await
642648
.map_err(DatabaseError::Io)?;
643649

@@ -682,7 +688,7 @@ impl WalletDatabase for CashuKvDatabase {
682688
async fn remove_keys(&self, id: &Id) -> Result<(), Self::Err> {
683689
let key = id.to_string();
684690

685-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, KEYS_KEY, &key)
691+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, KEYS_KEY, &key, false)
686692
.await
687693
.map_err(DatabaseError::Io)?;
688694

@@ -707,7 +713,7 @@ impl WalletDatabase for CashuKvDatabase {
707713
for y in &removed_ys {
708714
let key = format!("proof_{}", hex::encode(y.serialize()));
709715

710-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, PROOFS_KEY, &key)
716+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, PROOFS_KEY, &key, false)
711717
.await
712718
.map_err(DatabaseError::Io)?;
713719
}
@@ -913,7 +919,7 @@ impl WalletDatabase for CashuKvDatabase {
913919
async fn remove_transaction(&self, transaction_id: TransactionId) -> Result<(), Self::Err> {
914920
let key = transaction_id.to_string();
915921

916-
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, TRANSACTIONS_KEY, &key)
922+
KVStore::remove(self.store.as_ref(), CASHU_PRIMARY_KEY, TRANSACTIONS_KEY, &key, false)
917923
.await
918924
.map_err(DatabaseError::Io)?;
919925

orange-sdk/src/trusted_wallet/spark/spark_store.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ fn sanitize_key(key: String) -> String {
3333
impl breez_sdk_spark::Storage for SparkStore {
3434
async fn delete_cached_item(&self, key: String) -> Result<(), StorageError> {
3535
let key = sanitize_key(key);
36-
KVStore::remove(self.0.as_ref(), SPARK_PRIMARY_NAMESPACE, SPARK_CACHE_NAMESPACE, &key, false)
37-
.await
38-
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
36+
KVStore::remove(
37+
self.0.as_ref(),
38+
SPARK_PRIMARY_NAMESPACE,
39+
SPARK_CACHE_NAMESPACE,
40+
&key,
41+
false,
42+
)
43+
.await
44+
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
3945
Ok(())
4046
}
4147

@@ -211,9 +217,15 @@ impl breez_sdk_spark::Storage for SparkStore {
211217

212218
async fn delete_deposit(&self, txid: String, vout: u32) -> Result<(), StorageError> {
213219
let id = format!("{txid}:{vout}");
214-
KVStore::remove(self.0.as_ref(), SPARK_PRIMARY_NAMESPACE, SPARK_DEPOSITS_NAMESPACE, &id)
215-
.await
216-
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
220+
KVStore::remove(
221+
self.0.as_ref(),
222+
SPARK_PRIMARY_NAMESPACE,
223+
SPARK_DEPOSITS_NAMESPACE,
224+
&id,
225+
false,
226+
)
227+
.await
228+
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
217229
Ok(())
218230
}
219231

0 commit comments

Comments
 (0)