lnwire: add custom records field to type UpdateFulfillHtlc
- Introduce the field `CustomRecords` to the type `UpdateFulfillHtlc`. - Encode and decode the new field into the `ExtraData` field of the `update_fulfill_htlc` wire message. - Empty `ExtraData` field is set to `nil`.
This commit is contained in:
1 parent
81f6a8060f
commit
8d1059f41c
5 files changed
+188
-6
No files matched your search
@@ -1442,6 +1442,29 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
v[0] = reflect.ValueOf(*req)
|
||||
},
|
||||
MsgUpdateFulfillHTLC: func(v []reflect.Value, r *rand.Rand) {
|
||||
req := &UpdateFulfillHTLC{
|
||||
ID: r.Uint64(),
|
||||
}
|
||||
|
||||
_, err := r.Read(req.ChanID[:])
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = r.Read(req.PaymentPreimage[:])
|
||||
require.NoError(t, err)
|
||||
|
||||
req.CustomRecords = randCustomRecords(t, r)
|
||||
|
||||
// Generate some random TLV records 50% of the time.
|
||||
if r.Int31()%2 == 0 {
|
||||
req.ExtraData = []byte{
|
||||
0x01, 0x03, 1, 2, 3,
|
||||
0x02, 0x03, 4, 5, 6,
|
||||
}
|
||||
}
|
||||
|
||||
v[0] = reflect.ValueOf(*req)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user