Skip to content

Commit 139b0f9

Browse files
fix: resolve CI failures for BOLT12 payer proof FFI build
- Use cfg-gated match to extract Bolt12Invoice correctly per build mode: non-uniffi uses PaidBolt12Invoice::Bolt12Invoice variant, uniffi uses PaidBolt12Invoice::Bolt12 variant and unwraps Arc + inner - Apply cargo fmt to fix formatting diffs - Remove redundant .clone() in PayerProofContext construction Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0aaab83 commit 139b0f9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/event.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,14 @@ where
563563
&self, payment_id: PaymentId, bolt12_invoice: &Option<PaidBolt12Invoice>,
564564
payment_nonce: Option<Nonce>,
565565
) {
566+
#[cfg(not(feature = "uniffi"))]
566567
let invoice = match bolt12_invoice {
567-
Some(PaidBolt12Invoice::Bolt12Invoice(invoice)) => invoice,
568+
Some(PaidBolt12Invoice::Bolt12Invoice(invoice)) => invoice.clone(),
569+
_ => return,
570+
};
571+
#[cfg(feature = "uniffi")]
572+
let invoice = match bolt12_invoice {
573+
Some(PaidBolt12Invoice::Bolt12(invoice)) => invoice.inner.clone(),
568574
_ => return,
569575
};
570576

@@ -573,7 +579,7 @@ where
573579
None => return,
574580
};
575581

576-
let context = PayerProofContext { payment_id, invoice: invoice.clone(), nonce };
582+
let context = PayerProofContext { payment_id, invoice, nonce };
577583
if let Err(e) = self.payer_proof_context_store.insert_or_update(context) {
578584
log_error!(
579585
self.logger,
@@ -1108,11 +1114,7 @@ where
11081114
};
11091115
let bolt12_invoice = bolt12_invoice.map(Into::into);
11101116

1111-
self.persist_payer_proof_context(
1112-
payment_id,
1113-
&bolt12_invoice,
1114-
payment_nonce,
1115-
);
1117+
self.persist_payer_proof_context(payment_id, &bolt12_invoice, payment_nonce);
11161118

11171119
let update = PaymentDetailsUpdate {
11181120
hash: Some(Some(payment_hash)),

src/io/sqlite_store/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ impl SqliteStoreInner {
684684
#[cfg(test)]
685685
mod tests {
686686
use super::*;
687-
688687
use crate::io::test_utils::{
689688
do_read_write_remove_list_persist, do_test_store, random_storage_path,
690689
};

0 commit comments

Comments
 (0)