@@ -52,10 +52,11 @@ var (
5252 CustomBlob : tlv .SomeRecordT (
5353 tlv.NewPrimitiveRecord [tlv.TlvType5 ](blobBytes ),
5454 ),
55+ HtlcIndex : tlv.NewPrimitiveRecord [tlv.TlvType6 , uint16 ](3 ),
5556 }
5657 testHTLCEntryBytes = []byte {
57- // Body length 28 .
58- 0x1c ,
58+ // Body length 32 .
59+ 0x20 ,
5960 // Rhash tlv.
6061 0x0 , 0x0 ,
6162 // RefundTimeout tlv.
6869 0x4 , 0x5 , 0xfe , 0x0 , 0xf , 0x42 , 0x40 ,
6970 // Custom blob tlv.
7071 0x5 , 0x4 , 0x1 , 0x2 , 0x3 , 0x4 ,
72+ // HLTC index tlv.
73+ 0x6 , 0x2 , 0x0 , 0x03 ,
7174 }
7275
7376 testHTLCEntryHash = HTLCEntry {
8689 ),
8790 }
8891 testHTLCEntryHashBytes = []byte {
89- // Body length 54 .
90- 0x36 ,
92+ // Body length 58 .
93+ 0x3a ,
9194 // Rhash tlv.
9295 0x0 , 0x20 ,
9396 0x33 , 0x44 , 0x55 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
@@ -102,6 +105,8 @@ var (
102105 0x3 , 0x1 , 0x1 ,
103106 // Amt tlv.
104107 0x4 , 0x5 , 0xfe , 0x0 , 0xf , 0x42 , 0x40 ,
108+ // HLTC index tlv.
109+ 0x6 , 0x2 , 0x0 , 0x00 ,
105110 }
106111
107112 localBalance = lnwire .MilliSatoshi (9000 )
@@ -118,6 +123,7 @@ var (
118123 Htlcs : []HTLC {{
119124 RefundTimeout : testHTLCEntry .RefundTimeout .Val ,
120125 OutputIndex : int32 (testHTLCEntry .OutputIndex .Val ),
126+ HtlcIndex : uint64 (testHTLCEntry .HtlcIndex .Val ),
121127 Incoming : testHTLCEntry .Incoming .Val ,
122128 Amt : lnwire .NewMSatFromSatoshis (
123129 testHTLCEntry .Amt .Val .Int (),
@@ -284,7 +290,7 @@ func TestSerializeHTLCEntries(t *testing.T) {
284290 partialBytes := testHTLCEntryBytes [3 :]
285291
286292 // Write the total length and RHash tlv.
287- expectedBytes := []byte {0x3c , 0x0 , 0x20 }
293+ expectedBytes := []byte {0x40 , 0x0 , 0x20 }
288294 expectedBytes = append (expectedBytes , rHashBytes ... )
289295
290296 // Append the rest.
@@ -399,7 +405,7 @@ func TestDeserializeHTLCEntries(t *testing.T) {
399405 partialBytes := testHTLCEntryBytes [3 :]
400406
401407 // Write the total length and RHash tlv.
402- testBytes := append ([]byte {0x3c , 0x0 , 0x20 }, rHashBytes ... )
408+ testBytes := append ([]byte {0x40 , 0x0 , 0x20 }, rHashBytes ... )
403409
404410 // Append the rest.
405411 testBytes = append (testBytes , partialBytes ... )
0 commit comments