lntest+itest: add new method AssertChannelInGraph

This commit replaces `AssertTopologyChannelOpen` with
`AssertChannelInGraph`, which asserts a given channel edge is found.
`AssertTopologyChannelOpen` only asserts a given edge has been received
via the topology subscription, while we need to make sure the channel is
in the graph before continuing our tests.
This commit is contained in:
yyforyongyu committed 2024-11-12 23:55:40 +08:00
1 parent 7dda2960a5
commit 653a8ac55e
25 files changed
+110 -87

No files matched your search

+6 -6
View File
@@ -344,7 +344,7 @@ func runMultiHopSendToRoute(ht *lntest.HarnessTest, useGraphCache bool) {
defer ht.CloseChannel(carol, chanPointBob)
// Make sure Alice knows the channel between Bob and Carol.
ht.AssertTopologyChannelOpen(alice, chanPointBob)
ht.AssertChannelInGraph(alice, chanPointBob)
// Create 5 invoices for Carol, which expect a payment from Alice for
// 1k satoshis with a different preimage each time.
@@ -965,7 +965,7 @@ func testMultiHopOverPrivateChannels(ht *lntest.HarnessTest) {
)
// Alice should know the new channel from Bob.
ht.AssertTopologyChannelOpen(alice, chanPointBob)
ht.AssertChannelInGraph(alice, chanPointBob)
// Next, we'll create Dave's node and open a private channel between
// him and Carol with Carol being the funder.
@@ -981,7 +981,7 @@ func testMultiHopOverPrivateChannels(ht *lntest.HarnessTest) {
)
// Dave should know the channel[Bob<->Carol] from Carol.
ht.AssertTopologyChannelOpen(dave, chanPointBob)
ht.AssertChannelInGraph(dave, chanPointBob)
// Now that all the channels are set up according to the topology from
// above, we can proceed to test payments. We'll create an invoice for
@@ -1077,8 +1077,8 @@ func testQueryRoutes(ht *lntest.HarnessTest) {
// Before we continue, give Alice some time to catch up with the newly
// opened channels.
ht.AssertTopologyChannelOpen(alice, chanPointBob)
ht.AssertTopologyChannelOpen(alice, chanPointCarol)
ht.AssertChannelInGraph(alice, chanPointBob)
ht.AssertChannelInGraph(alice, chanPointCarol)
// Query for routes to pay from Alice to Dave.
const paymentAmt = 1000
@@ -1389,7 +1389,7 @@ func testRouteFeeCutoff(ht *lntest.HarnessTest) {
}
for _, chanPoint := range networkChans {
for _, node := range nodes {
ht.AssertTopologyChannelOpen(node, chanPoint)
ht.AssertChannelInGraph(node, chanPoint)
}
}