mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
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:
@@ -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