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.
This commit is contained in:
Carla Kirk-Cohen 2023-11-01 15:24:57 -04:00
parent b0870ea2ed
commit fa78d21975
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91

View file

@ -65,14 +65,16 @@ func TestSphinxHopIteratorForwardingInstructions(t *testing.T) {
}, },
expectedFwdInfo: expectedFwdInfo, expectedFwdInfo: expectedFwdInfo,
}, },
// A TLV payload, we can leave off the action as we'll always // A TLV payload, which includes the sphinx action as
// read the cid encoded. // cid may be zero for blinded routes (thus we require the
// action to signal whether we are at the final hop).
{ {
sphinxPacket: &sphinx.ProcessedPacket{ sphinxPacket: &sphinx.ProcessedPacket{
Payload: sphinx.HopPayload{ Payload: sphinx.HopPayload{
Type: sphinx.PayloadTLV, Type: sphinx.PayloadTLV,
Payload: b.Bytes(), Payload: b.Bytes(),
}, },
Action: sphinx.MoreHops,
}, },
expectedFwdInfo: expectedFwdInfo, expectedFwdInfo: expectedFwdInfo,
}, },