mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
lnwire: define NodeAnnouncement2
In this commit, the lnwire.NodeAnnouncement2 type is defined. This will be used to represent the `node_announcement_2` message used in the Gossip 2 (1.75) protocol.
This commit is contained in:
@@ -244,6 +244,30 @@ func FuzzNodeAnnouncement(f *testing.F) {
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzNodeAnnouncement2(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
// We can't use require.Equal for Features, since we consider
|
||||
// the empty map and nil to be equivalent.
|
||||
assertEq := func(t *testing.T, x, y any) {
|
||||
require.IsType(t, &NodeAnnouncement2{}, x)
|
||||
first, _ := x.(*NodeAnnouncement2)
|
||||
require.IsType(t, &NodeAnnouncement2{}, y)
|
||||
second, _ := y.(*NodeAnnouncement2)
|
||||
|
||||
require.True(
|
||||
t,
|
||||
first.Features.Val.Equals(&second.Features.Val),
|
||||
)
|
||||
first.Features.Val = *NewRawFeatureVector()
|
||||
second.Features.Val = *NewRawFeatureVector()
|
||||
|
||||
require.Equal(t, first, second)
|
||||
}
|
||||
|
||||
wireMsgHarnessCustom(t, data, MsgNodeAnnouncement2, assertEq)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzOpenChannel(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
// We can't use require.Equal for UpfrontShutdownScript, since
|
||||
|
||||
Reference in New Issue
Block a user