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
@@ -927,8 +927,8 @@ func testChannelFundingPersistence(ht *lntest.HarnessTest) {
// Make sure Alice and Carol have seen the channel in their network
// topology.
ht.AssertTopologyChannelOpen(alice, chanPoint)
ht.AssertTopologyChannelOpen(carol, chanPoint)
ht.AssertChannelInGraph(alice, chanPoint)
ht.AssertChannelInGraph(carol, chanPoint)
// Create an additional check for our channel assertion that will
// check that our label is as expected.
@@ -1055,7 +1055,7 @@ func testBatchChanFunding(ht *lntest.HarnessTest) {
// Ensure that Alice can send funds to Eve via the zero-conf channel
// before the batch transaction was mined.
ht.AssertTopologyChannelOpen(alice, chanPoint4)
ht.AssertChannelInGraph(alice, chanPoint4)
eveInvoiceParams := &lnrpc.Invoice{
Value: int64(10_000),
Private: true,
@@ -1068,9 +1068,9 @@ func testBatchChanFunding(ht *lntest.HarnessTest) {
// Mine the batch transaction and check the network topology.
block := ht.MineBlocksAndAssertNumTxes(6, 1)[0]
ht.AssertTxInBlock(block, *txHash)
ht.AssertTopologyChannelOpen(alice, chanPoint1)
ht.AssertTopologyChannelOpen(alice, chanPoint2)
ht.AssertTopologyChannelOpen(alice, chanPoint3)
ht.AssertChannelInGraph(alice, chanPoint1)
ht.AssertChannelInGraph(alice, chanPoint2)
ht.AssertChannelInGraph(alice, chanPoint3)
// Check if the change type from the batch_open_channel funding is P2TR.
rawTx := ht.GetRawTransaction(*txHash)