From fa78d219759801188e2fa7e194334bd3597de483 Mon Sep 17 00:00:00 2001 From: Carla Kirk-Cohen Date: Wed, 1 Nov 2023 15:24:57 -0400 Subject: [PATCH] htlcswitch/test: add sphinx action to decoding test Update test to include the sphinx action to more closely represent reality. This will be required when we add more validation to the presence of a nextChanID field. A MoreHops action is chose because we're testing the case with a payload that contains forwarding info. --- htlcswitch/hop/iterator_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htlcswitch/hop/iterator_test.go b/htlcswitch/hop/iterator_test.go index 524b70df0..cb2a2816f 100644 --- a/htlcswitch/hop/iterator_test.go +++ b/htlcswitch/hop/iterator_test.go @@ -65,14 +65,16 @@ func TestSphinxHopIteratorForwardingInstructions(t *testing.T) { }, expectedFwdInfo: expectedFwdInfo, }, - // A TLV payload, we can leave off the action as we'll always - // read the cid encoded. + // A TLV payload, which includes the sphinx action as + // cid may be zero for blinded routes (thus we require the + // action to signal whether we are at the final hop). { sphinxPacket: &sphinx.ProcessedPacket{ Payload: sphinx.HopPayload{ Type: sphinx.PayloadTLV, Payload: b.Bytes(), }, + Action: sphinx.MoreHops, }, expectedFwdInfo: expectedFwdInfo, },