mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-13 18:10:25 +02:00
lnwire_test: fix BenchmarkReadMessage test
The addition of AliasScid in the tlv_stream field of the funding_locked msg made the requirement for testdata of the ExtraOpaqueData part for the funding_locked msg type more strict. Now the input testdata for the funding_locked test is more specific and includes the new added AliasScid tlv record.
This commit is contained in:
@@ -452,8 +452,20 @@ func newMsgChannelReady(t testing.TB, r io.Reader) *lnwire.ChannelReady {
|
|||||||
|
|
||||||
pubKey := randPubKey(t)
|
pubKey := randPubKey(t)
|
||||||
|
|
||||||
msg := lnwire.NewChannelReady(lnwire.ChannelID(c), pubKey)
|
// When testing the ChannelReady msg type in the WriteMessage
|
||||||
msg.ExtraData = createExtraData(t, r)
|
// function we need to populate the alias here to test the encoding
|
||||||
|
// of the TLV stream.
|
||||||
|
aliasScid := lnwire.NewShortChanIDFromInt(rand.Uint64())
|
||||||
|
msg := &lnwire.ChannelReady{
|
||||||
|
ChanID: lnwire.ChannelID(c),
|
||||||
|
NextPerCommitmentPoint: pubKey,
|
||||||
|
AliasScid: &aliasScid,
|
||||||
|
ExtraData: make([]byte, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
// We do not include the TLV record (aliasScid) into the ExtraData
|
||||||
|
// because when the msg is encoded the ExtraData is overwritten
|
||||||
|
// with the current aliasScid value.
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user