Skip to content

Commit f86dc89

Browse files
committed
fixup! sphinx_test: onion message packet creation
1 parent 8499b32 commit f86dc89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sphinx_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,14 @@ func TestBolt4Packet(t *testing.T) {
342342
}
343343
}
344344

345+
// TestTLVPayloadMessagePacket tests the creation and encoding of an onion
346+
// message packet that uses a TLV payload for each hop in the route. This test
347+
// uses the test vectors defined in the BOLT 4 specification. The test reads a
348+
// JSON file containing a predefined route, session key, and the expected final
349+
// onion packet. It then constructs the route hop-by-hop, manually creating the
350+
// TLV payload for each, before creating a new onion packet with NewOnionPacket.
351+
// The test concludes by asserting that the newly encoded packet is identical to
352+
// the one specified in the test vector.
345353
func TestTLVPayloadMessagePacket(t *testing.T) {
346354
t.Parallel()
347355

0 commit comments

Comments
 (0)