Skip to content

Commit 6bcb34c

Browse files
authored
Merge pull request #93 from lightningdevkit/single-key-cashu-proofs
Store Cashu proofs in one blob
2 parents 4e9d230 + 1c2eff8 commit 6bcb34c

4 files changed

Lines changed: 317 additions & 88 deletions

File tree

orange-sdk/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name = "orange_sdk"
1616
default = ["spark"]
1717
uniffi = ["dep:uniffi", "spark", "cashu", "rand", "pin-project-lite"]
1818
spark = ["breez-sdk-spark", "uuid", "serde_json"]
19-
cashu = ["cdk", "cdk/npubcash", "serde_json"]
19+
cashu = ["cdk", "cdk/npubcash", "serde", "serde_json"]
2020
_test-utils = ["corepc-node", 'electrsd', "cashu", "uuid/v7", "rand"]
2121
_cashu-tests = ["_test-utils", "cdk-ldk-node", "cdk/mint", "cdk-sqlite", "cdk-axum", "axum"]
2222

@@ -32,6 +32,7 @@ breez-sdk-spark = { git = "https://github.com/breez/spark-sdk.git", rev = "0d8db
3232
tokio = { version = "1.0", default-features = false, features = ["rt-multi-thread", "sync", "macros"] }
3333
uuid = { version = "1.0", default-features = false, optional = true }
3434
cdk = { version = "0.16.0", default-features = false, features = ["wallet"], optional = true }
35+
serde = { version = "1.0", features = ["derive"], optional = true }
3536
serde_json = { version = "1.0", optional = true }
3637
async-trait = "0.1"
3738
log = "0.4.28"

orange-sdk/src/ffi/orange/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ impl From<OrangeVssAuth> for VssAuth {
125125
/// failures are unrecoverable, i.e., if they remain unresolved after internal
126126
/// retries are exhausted.
127127
///
128+
/// A VSS store must only be used by one active wallet instance at a time. Cashu
129+
/// proof mutations are serialized within one process, but separate instances can
130+
/// overwrite each other's proof snapshots.
131+
///
128132
/// [Versioned Storage Service (VSS)]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
129133
#[derive(Debug, Clone, uniffi::Object)]
130134
pub struct VssConfig {

orange-sdk/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ pub enum VssAuth {
218218
/// failures are unrecoverable, i.e., if they remain unresolved after internal
219219
/// retries are exhausted.
220220
///
221+
/// A VSS store must only be used by one active wallet instance at a time. Cashu
222+
/// proof mutations are serialized within one process, but separate instances can
223+
/// overwrite each other's proof snapshots.
224+
///
221225
/// [Versioned Storage Service (VSS)]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
222226
#[derive(Debug, Clone)]
223227
pub struct VssConfig {
@@ -1030,7 +1034,7 @@ impl Wallet {
10301034
payment_type: (&payment).into(),
10311035
time_since_epoch: tx_metadata.time,
10321036
}),
1033-
TxType::MppPayment { surface_id, total_amount_msat, ty: _, .. } => {
1037+
TxType::MppPayment { surface_id, total_amount_msat, .. } => {
10341038
let entry = mpp_payments.entry(*surface_id).or_default();
10351039
entry.accumulate(
10361040
MppLegKind::Lightning,

0 commit comments

Comments
 (0)