mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-23 12:13:50 +02:00
graph/db: migration test for channels with no policies
In preparation for making the channel & policy migration logic idempotent in a step-by-step manner, we add a test here that only tests the migration of channels _without_ policies so that we can first focus on just making the channel migration idempotent.
This commit is contained in:
@@ -176,6 +176,60 @@ func TestMigrateGraphToSQL(t *testing.T) {
|
||||
},
|
||||
expNotRetrySafety: true,
|
||||
},
|
||||
{
|
||||
name: "channel with no policies",
|
||||
write: writeUpdate,
|
||||
objects: []any{
|
||||
// A channel with unknown nodes. This will
|
||||
// result in two shell nodes being created.
|
||||
// - channel count += 1
|
||||
// - node count += 2
|
||||
makeTestChannel(t),
|
||||
|
||||
// Insert some nodes.
|
||||
// - node count += 1
|
||||
makeTestNode(t, func(n *models.LightningNode) {
|
||||
n.PubKeyBytes = node1
|
||||
}),
|
||||
// - node count += 1
|
||||
makeTestNode(t, func(n *models.LightningNode) {
|
||||
n.PubKeyBytes = node2
|
||||
}),
|
||||
|
||||
// A channel with known nodes.
|
||||
// - channel count += 1
|
||||
makeTestChannel(
|
||||
t, func(c *models.ChannelEdgeInfo) {
|
||||
c.ChannelID = chanID1
|
||||
|
||||
c.NodeKey1Bytes = node1
|
||||
c.NodeKey2Bytes = node2
|
||||
},
|
||||
),
|
||||
|
||||
// Insert a channel with no auth proof, no
|
||||
// extra opaque data, and empty features.
|
||||
// Use known nodes.
|
||||
// - channel count += 1
|
||||
makeTestChannel(
|
||||
t, func(c *models.ChannelEdgeInfo) {
|
||||
c.ChannelID = chanID2
|
||||
|
||||
c.NodeKey1Bytes = node1
|
||||
c.NodeKey2Bytes = node2
|
||||
|
||||
c.AuthProof = nil
|
||||
c.ExtraOpaqueData = nil
|
||||
c.Features = testEmptyFeatures
|
||||
},
|
||||
),
|
||||
},
|
||||
expGraphStats: graphStats{
|
||||
numNodes: 4,
|
||||
numChannels: 3,
|
||||
},
|
||||
expNotRetrySafety: true,
|
||||
},
|
||||
{
|
||||
name: "channels and policies",
|
||||
write: writeUpdate,
|
||||
|
Reference in New Issue
Block a user