Skip to content

Commit dde5b3f

Browse files
committed
ldk 0.2.0-rc1
1 parent ecec612 commit dde5b3f

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
@@ -18,7 +18,7 @@ _cashu-tests = ["_test-utils", "cdk-ldk-node", "cdk/mint", "cdk-sqlite", "cdk-ax
1818
[dependencies]
1919
graduated-rebalancer = { path = "../graduated-rebalancer", version = "0.1.0" }
2020

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

3535
corepc-node = { version = "0.8.0", features = ["29_0", "download"], optional = true }
36-
cdk-ldk-node = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
37-
cdk-sqlite = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
38-
cdk-axum = { git = "https://github.com/benthecarman/cdk.git", rev = "62ac47d51d6c74c7b847ae0c19e7c84899efe872", optional = true }
36+
cdk-ldk-node = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
37+
cdk-sqlite = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
38+
cdk-axum = { git = "https://github.com/benthecarman/cdk.git", rev = "f95a3cfc3b48913e399ea6b080d99b5566437d0a", optional = true }
3939
axum = { version = "0.8.1", optional = true }
4040

4141
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
@@ -19,9 +19,15 @@ pub(crate) struct SparkStore(pub(crate) Arc<DynStore>);
1919
#[async_trait::async_trait]
2020
impl breez_sdk_spark::Storage for SparkStore {
2121
async fn delete_cached_item(&self, key: String) -> Result<(), StorageError> {
22-
KVStore::remove(self.0.as_ref(), SPARK_PRIMARY_NAMESPACE, SPARK_CACHE_NAMESPACE, &key)
23-
.await
24-
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
22+
KVStore::remove(
23+
self.0.as_ref(),
24+
SPARK_PRIMARY_NAMESPACE,
25+
SPARK_CACHE_NAMESPACE,
26+
&key,
27+
false,
28+
)
29+
.await
30+
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
2531
Ok(())
2632
}
2733

@@ -161,9 +167,15 @@ impl breez_sdk_spark::Storage for SparkStore {
161167

162168
async fn delete_deposit(&self, txid: String, vout: u32) -> Result<(), StorageError> {
163169
let id = format!("{txid}:{vout}");
164-
KVStore::remove(self.0.as_ref(), SPARK_PRIMARY_NAMESPACE, SPARK_DEPOSITS_NAMESPACE, &id)
165-
.await
166-
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
170+
KVStore::remove(
171+
self.0.as_ref(),
172+
SPARK_PRIMARY_NAMESPACE,
173+
SPARK_DEPOSITS_NAMESPACE,
174+
&id,
175+
false,
176+
)
177+
.await
178+
.map_err(|e| StorageError::Implementation(format!("{e:?}")))?;
167179
Ok(())
168180
}
169181

0 commit comments

Comments
 (0)