multi: rename lnwire.NodeAnnouncement
In preparation for adding a NodeAnnouncement2 struct along with a NodeAnnouncement interface, this commit renames the existing NodeAnnouncment struct to NodeAnnouncement1.
This commit is contained in:
22 files changed
+145
-131
No files matched your search
+15
-14
@@ -493,8 +493,8 @@ func (m *mockNotifier) Stop() error {
|
||||
}
|
||||
|
||||
type annBatch struct {
|
||||
nodeAnn1 *lnwire.NodeAnnouncement
|
||||
nodeAnn2 *lnwire.NodeAnnouncement
|
||||
nodeAnn1 *lnwire.NodeAnnouncement1
|
||||
nodeAnn2 *lnwire.NodeAnnouncement1
|
||||
|
||||
chanAnn *lnwire.ChannelAnnouncement1
|
||||
|
||||
@@ -577,8 +577,8 @@ func (ctx *testCtx) createAnnouncements(blockHeight uint32, key1,
|
||||
|
||||
}
|
||||
|
||||
func createNodeAnnouncement(priv *btcec.PrivateKey,
|
||||
timestamp uint32, extraBytes ...[]byte) (*lnwire.NodeAnnouncement, error) {
|
||||
func createNodeAnnouncement(priv *btcec.PrivateKey, timestamp uint32,
|
||||
extraBytes ...[]byte) (*lnwire.NodeAnnouncement1, error) {
|
||||
|
||||
var err error
|
||||
k := hex.EncodeToString(priv.Serialize())
|
||||
@@ -587,7 +587,7 @@ func createNodeAnnouncement(priv *btcec.PrivateKey,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a := &lnwire.NodeAnnouncement{
|
||||
a := &lnwire.NodeAnnouncement1{
|
||||
Timestamp: timestamp,
|
||||
Addresses: testAddrs,
|
||||
Alias: alias,
|
||||
@@ -966,15 +966,15 @@ func createTestCtx(t *testing.T, startHeight uint32, isChanPeer bool) (
|
||||
c := make(chan struct{})
|
||||
return c
|
||||
},
|
||||
FetchSelfAnnouncement: func() lnwire.NodeAnnouncement {
|
||||
return lnwire.NodeAnnouncement{
|
||||
FetchSelfAnnouncement: func() lnwire.NodeAnnouncement1 {
|
||||
return lnwire.NodeAnnouncement1{
|
||||
Timestamp: testTimestamp,
|
||||
}
|
||||
},
|
||||
UpdateSelfAnnouncement: func() (lnwire.NodeAnnouncement,
|
||||
UpdateSelfAnnouncement: func() (lnwire.NodeAnnouncement1,
|
||||
error) {
|
||||
|
||||
return lnwire.NodeAnnouncement{
|
||||
return lnwire.NodeAnnouncement1{
|
||||
Timestamp: testTimestamp,
|
||||
}, nil
|
||||
},
|
||||
@@ -2285,7 +2285,7 @@ func TestForwardPrivateNodeAnnouncement(t *testing.T) {
|
||||
case <-time.After(2 * trickleDelay):
|
||||
}
|
||||
|
||||
// Now, we'll attempt to forward the NodeAnnouncement for the same node
|
||||
// Now, we'll attempt to forward the NodeAnnouncement1 for the same node
|
||||
// by opening a public channel on the network. We'll create a
|
||||
// ChannelAnnouncement and hand it off to the gossiper in order to
|
||||
// process it.
|
||||
@@ -2312,8 +2312,9 @@ func TestForwardPrivateNodeAnnouncement(t *testing.T) {
|
||||
t.Fatal("gossiper should have broadcast the channel announcement")
|
||||
}
|
||||
|
||||
// We'll recreate the NodeAnnouncement with an updated timestamp to
|
||||
// prevent a stale update. The NodeAnnouncement should now be forwarded.
|
||||
// We'll recreate the NodeAnnouncement1 with an updated timestamp to
|
||||
// prevent a stale update. The NodeAnnouncement1 should now be
|
||||
// forwarded.
|
||||
nodeAnn, err = createNodeAnnouncement(remoteKeyPriv1, timestamp+1)
|
||||
require.NoError(t, err, "unable to create node announcement")
|
||||
|
||||
@@ -2897,7 +2898,7 @@ func TestExtraDataChannelUpdateValidation(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestExtraDataNodeAnnouncementValidation tests that we're able to properly
|
||||
// validate a NodeAnnouncement that includes opaque bytes that we don't
|
||||
// validate a NodeAnnouncement1 that includes opaque bytes that we don't
|
||||
// currently know of.
|
||||
func TestExtraDataNodeAnnouncementValidation(t *testing.T) {
|
||||
t.Parallel()
|
||||
@@ -3044,7 +3045,7 @@ func TestRetransmit(t *testing.T) {
|
||||
chanAnn++
|
||||
case *lnwire.ChannelUpdate1:
|
||||
chanUpd++
|
||||
case *lnwire.NodeAnnouncement:
|
||||
case *lnwire.NodeAnnouncement1:
|
||||
nodeAnn++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user