Skip to content

Commit 15eeebd

Browse files
fix: resolve payer proof CI failures
Fix the formatting drift introduced by the payer proof follow-up cherry-picks and update the stale splicing test to use the current RecipientOnionFields::secret_only signature so the CI build matrix compiles again.
1 parent 51c77e1 commit 15eeebd

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

lightning/src/ln/splicing_tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,14 +2987,14 @@ fn do_abandon_splice_quiescent_action_on_shutdown(local_shutdown: bool, pending_
29872987
splice_channel(&nodes[0], &nodes[1], channel_id, funding_contribution);
29882988
}
29892989

2990-
// Since we cannot close after having sent `stfu`, send an HTLC so that when we attempt to
2991-
// splice, the `stfu` message is held back.
2992-
let payment_amount = 1_000_000;
2993-
let (route, payment_hash, _payment_preimage, payment_secret) =
2994-
get_route_and_payment_hash!(&nodes[0], &nodes[1], payment_amount);
2995-
let onion = RecipientOnionFields::secret_only(payment_secret, payment_amount);
2996-
let payment_id = PaymentId(payment_hash.0);
2997-
nodes[0].node.send_payment_with_route(route, payment_hash, onion, payment_id).unwrap();
2990+
// Since we cannot close after having sent `stfu`, send an HTLC so that when we attempt to
2991+
// splice, the `stfu` message is held back.
2992+
let payment_amount = 1_000_000;
2993+
let (route, payment_hash, _payment_preimage, payment_secret) =
2994+
get_route_and_payment_hash!(&nodes[0], &nodes[1], payment_amount);
2995+
let onion = RecipientOnionFields::secret_only(payment_secret, payment_amount);
2996+
let payment_id = PaymentId(payment_hash.0);
2997+
nodes[0].node.send_payment_with_route(route, payment_hash, onion, payment_id).unwrap();
29982998
let update = get_htlc_update_msgs(&nodes[0], &node_id_1);
29992999
check_added_monitors(&nodes[0], 1);
30003000

lightning/src/offers/payer_proof.rs

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ impl<'a> PayerProofBuilder<'a> {
253253
for r in TlvStream::new(&invoice_bytes).filter(|r| !SIGNATURE_TYPES.contains(&r.r#type)) {
254254
bytes_without_sig.extend_from_slice(r.record_bytes);
255255
}
256-
let disclosed_fields = extract_disclosed_fields(
257-
TlvStream::new(&invoice_bytes)
258-
.filter(|r| self.included_types.contains(&r.r#type) && !SIGNATURE_TYPES.contains(&r.r#type)),
259-
)?;
256+
let disclosed_fields =
257+
extract_disclosed_fields(TlvStream::new(&invoice_bytes).filter(|r| {
258+
self.included_types.contains(&r.r#type) && !SIGNATURE_TYPES.contains(&r.r#type)
259+
}))?;
260260

261261
let disclosure =
262262
merkle::compute_selective_disclosure(&bytes_without_sig, &self.included_types)?;
@@ -347,9 +347,9 @@ impl UnsignedPayerProof {
347347
// Preserve TLV ordering by emitting included invoice records below the
348348
// payer-proof range first, then payer-proof TLVs (240..=250), then any
349349
// disclosed experimental invoice records above the reserved range.
350-
for record in TlvStream::new(&self.invoice_bytes).filter(|r| {
351-
self.included_types.contains(&r.r#type) && r.r#type < TLV_SIGNATURE
352-
}) {
350+
for record in TlvStream::new(&self.invoice_bytes)
351+
.filter(|r| self.included_types.contains(&r.r#type) && r.r#type < TLV_SIGNATURE)
352+
{
353353
bytes.extend_from_slice(record.record_bytes);
354354
}
355355

@@ -518,12 +518,14 @@ fn update_disclosed_fields(
518518
match record.r#type {
519519
OFFER_DESCRIPTION_TYPE => {
520520
disclosed_fields.offer_description = Some(
521-
String::from_utf8(record.value_bytes.to_vec()).map_err(|_| DecodeError::InvalidValue)?,
521+
String::from_utf8(record.value_bytes.to_vec())
522+
.map_err(|_| DecodeError::InvalidValue)?,
522523
);
523524
},
524525
OFFER_ISSUER_TYPE => {
525526
disclosed_fields.offer_issuer = Some(
526-
String::from_utf8(record.value_bytes.to_vec()).map_err(|_| DecodeError::InvalidValue)?,
527+
String::from_utf8(record.value_bytes.to_vec())
528+
.map_err(|_| DecodeError::InvalidValue)?,
527529
);
528530
},
529531
INVOICE_CREATED_AT_TYPE => {
@@ -757,18 +759,18 @@ impl TryFrom<Vec<u8>> for PayerProof {
757759

758760
Ok(PayerProof {
759761
bytes,
760-
contents: PayerProofContents {
761-
payer_id,
762-
payment_hash,
763-
issuer_signing_pubkey,
764-
preimage,
765-
invoice_signature,
766-
payer_signature,
767-
payer_note,
768-
disclosed_fields,
769-
},
770-
merkle_root,
771-
})
762+
contents: PayerProofContents {
763+
payer_id,
764+
payment_hash,
765+
issuer_signing_pubkey,
766+
preimage,
767+
invoice_signature,
768+
payer_signature,
769+
payer_note,
770+
disclosed_fields,
771+
},
772+
merkle_root,
773+
})
772774
}
773775
}
774776

@@ -903,7 +905,8 @@ mod tests {
903905
b"experimental-payer-proof-field",
904906
);
905907

906-
let invoice_message = TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
908+
let invoice_message =
909+
TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
907910
let invoice_signature =
908911
secp_ctx.sign_schnorr_no_aux_rand(invoice_message.as_digest(), &issuer_keys);
909912

@@ -960,7 +963,8 @@ mod tests {
960963
write_tlv_record_bytes(&mut invoice_bytes, 1_000_000_001, b"first-omitted-experimental");
961964
write_tlv_record_bytes(&mut invoice_bytes, 1_000_000_003, b"second-omitted-experimental");
962965

963-
let invoice_message = TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
966+
let invoice_message =
967+
TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
964968
let invoice_signature =
965969
secp_ctx.sign_schnorr_no_aux_rand(invoice_message.as_digest(), &issuer_keys);
966970

@@ -1024,7 +1028,8 @@ mod tests {
10241028
);
10251029
write_tlv_record(&mut invoice_bytes, INVOICE_NODE_ID_TYPE, &issuer_signing_pubkey);
10261030

1027-
let invoice_message = TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
1031+
let invoice_message =
1032+
TaggedHash::from_valid_tlv_stream_bytes(SIGNATURE_TAG, &invoice_bytes);
10281033
let invoice_signature =
10291034
secp_ctx.sign_schnorr_no_aux_rand(invoice_message.as_digest(), &issuer_keys);
10301035

0 commit comments

Comments
 (0)