multi: rename models.LightningNode to models.Node

This commit is contained in:
Elle Mouton committed 2025-09-03 10:14:35 +02:00
1 parent ea6cc8154f
commit c663a557c4
26 files changed
+212 -214

No files matched your search

+4 -4
View File
@@ -219,7 +219,7 @@ func parseTestGraph(t *testing.T, useCache bool, path string) (
privKeyMap := make(map[string]*btcec.PrivateKey)
channelIDs := make(map[route.Vertex]map[route.Vertex]uint64)
links := make(map[lnwire.ShortChannelID]htlcswitch.ChannelLink)
var source *models.LightningNode
var source *models.Node
// First we insert all the nodes within the graph as vertexes.
for _, node := range g.Nodes {
@@ -228,7 +228,7 @@ func parseTestGraph(t *testing.T, useCache bool, path string) (
return nil, err
}
dbNode := &models.LightningNode{
dbNode := &models.Node{
HaveNodeAnnouncement: true,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
@@ -565,7 +565,7 @@ func createTestGraphFromChannels(t *testing.T, useCache bool,
features = lnwire.EmptyFeatureVector()
}
dbNode := &models.LightningNode{
dbNode := &models.Node{
HaveNodeAnnouncement: true,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
@@ -1253,7 +1253,7 @@ func runPathFindingWithAdditionalEdges(t *testing.T, useCache bool) {
dogePubKey, err := btcec.ParsePubKey(dogePubKeyBytes)
require.NoError(t, err, "unable to parse public key from bytes")
doge := &models.LightningNode{}
doge := &models.Node{}
doge.AddPubKey(dogePubKey)
doge.Alias = "doge"
copy(doge.PubKeyBytes[:], dogePubKeyBytes)
+2 -2
View File
@@ -24,7 +24,7 @@ type SessionSource struct {
GraphSessionFactory GraphSessionFactory
// SourceNode is the graph's source node.
SourceNode *models.LightningNode
SourceNode *models.Node
// GetLink is a method that allows querying the lower link layer
// to determine the up to date available bandwidth at a prospective link
@@ -102,7 +102,7 @@ func RouteHintsToEdges(routeHints [][]zpay32.HopHint, target route.Vertex) (
// we'll need to look at the next hint's start node. If
// we've reached the end of the hints list, we can
// assume we've reached the destination.
endNode := &models.LightningNode{}
endNode := &models.Node{}
if i != len(routeHint)-1 {
endNode.AddPubKey(routeHint[i+1].NodeID)
} else {
+1 -1
View File
@@ -89,7 +89,7 @@ func TestUpdateAdditionalEdge(t *testing.T) {
// Create a minimal test node using the private key priv1.
pub := priv1.PubKey().SerializeCompressed()
testNode := &models.LightningNode{}
testNode := &models.Node{}
copy(testNode.PubKeyBytes[:], pub)
nodeID, err := testNode.PubKey()
+4 -4
View File
@@ -183,7 +183,7 @@ func createTestCtxFromGraphInstanceAssumeValid(t *testing.T,
return ctx
}
func createTestNode() (*models.LightningNode, error) {
func createTestNode() (*models.Node, error) {
updateTime := rand.Int63()
priv, err := btcec.NewPrivateKey()
@@ -192,7 +192,7 @@ func createTestNode() (*models.LightningNode, error) {
}
pub := priv.PubKey().SerializeCompressed()
n := &models.LightningNode{
n := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(updateTime, 0),
Addresses: testAddrs,
@@ -2871,7 +2871,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
// Now check that we can update the node info for the partial node
// without messing up the channel graph.
n1 := &models.LightningNode{
n1 := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,
@@ -2884,7 +2884,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
require.NoError(t, ctx.graph.AddLightningNode(ctxb, n1))
n2 := &models.LightningNode{
n2 := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,