htlcswitch: relay experimental endorsement signal with update_add_htlc

This commit is contained in:
Carla Kirk-Cohen committed 2024-11-22 09:16:56 -05:00
1 parent 94f7ed46de
commit 774bfa740a
9 files changed
+134 -11

No files matched your search

+3 -2
View File
@@ -530,9 +530,10 @@ func testForwardInterceptorWireRecords(ht *lntest.HarnessTest) {
require.NoError(ht, err, "failed to send request")
// Assert that the Alice -> Bob custom records in update_add_htlc are
// not propagated on the Bob -> Carol link.
// not propagated on the Bob -> Carol link, just an endorsement signal.
packet = ht.ReceiveHtlcInterceptor(carolInterceptor)
require.Len(ht, packet.InWireCustomRecords, 0)
require.Equal(ht, lntest.CustomRecordsWithUnendorsed(nil),
packet.InWireCustomRecords)
// We're going to tell Carol to forward 5k sats less to Dave. We need to
// set custom records on the HTLC as well, to make sure the HTLC isn't
+8 -4
View File
@@ -102,9 +102,12 @@ func testInvoiceHtlcModifierBasic(ht *lntest.HarnessTest) {
require.EqualValues(
ht, tc.sendAmountMsat, modifierRequest.ExitHtlcAmt,
)
// Expect custom records plus endorsement signal.
require.Equal(
ht, tc.lastHopCustomRecords,
modifierRequest.ExitHtlcWireCustomRecords,
ht, lntest.CustomRecordsWithUnendorsed(
tc.lastHopCustomRecords,
), modifierRequest.ExitHtlcWireCustomRecords,
)
// For all other packets we resolve according to the test case.
@@ -140,8 +143,9 @@ func testInvoiceHtlcModifierBasic(ht *lntest.HarnessTest) {
require.Len(ht, updatedInvoice.Htlcs, 1)
require.Equal(
ht, tc.lastHopCustomRecords,
updatedInvoice.Htlcs[0].CustomRecords,
ht, lntest.CustomRecordsWithUnendorsed(
tc.lastHopCustomRecords,
), updatedInvoice.Htlcs[0].CustomRecords,
)
// Make sure the custom channel data contains the encoded