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:
@@ -152,6 +152,19 @@ func RandNodeAlias(t *rapid.T) NodeAlias {
|
||||
return alias
|
||||
}
|
||||
|
||||
// RandNodeAlias2 generates a random node alias that is compatible with
|
||||
// NodeAlias2 validation (non-empty, max 32 bytes, valid UTF-8).
|
||||
func RandNodeAlias2(t *rapid.T) NodeAlias2 {
|
||||
// Ensure length is at least 1 to satisfy NodeAlias2 validation
|
||||
aliasLength := rapid.IntRange(1, 32).Draw(t, "aliasLength")
|
||||
|
||||
aliasBytes := rapid.SliceOfN(
|
||||
rapid.SampledFrom([]rune(charset)), aliasLength, aliasLength,
|
||||
).Draw(t, "alias")
|
||||
|
||||
return []byte(string(aliasBytes))
|
||||
}
|
||||
|
||||
// RandNetAddrs generates random network addresses.
|
||||
func RandNetAddrs(t *rapid.T) []net.Addr {
|
||||
numAddresses := rapid.IntRange(0, 5).Draw(t, "numAddresses")
|
||||
|
||||
Reference in New Issue
Block a user