Skip to content

Commit dc6012f

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 6455eee commit dc6012f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
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)),

0 commit comments

Comments
 (0)