itest: use ht.CreateSimpleNetwork whenever applicable

So we won't forget to assert the topology after opening a chain of
channels.
This commit is contained in:
yyforyongyu
2024-11-03 13:34:16 +08:00
parent 4eea2078fb
commit fee6b70519
4 changed files with 86 additions and 156 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/lightningnetwork/lnd/lnrpc/devrpc"
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
"github.com/lightningnetwork/lnd/lntest"
"github.com/lightningnetwork/lnd/lntest/node"
"github.com/stretchr/testify/require"
)
@@ -16,12 +17,14 @@ import (
// NOTE FOR REVIEW: this could be improved by blasting the channel with HTLC
// traffic on both sides to increase the surface area of the change under test.
func testQuiescence(ht *lntest.HarnessTest) {
alice := ht.NewNodeWithCoins("Alice", nil)
bob := ht.NewNode("Bob", nil)
cfg := node.CfgAnchor
chanPoints, nodes := ht.CreateSimpleNetwork(
[][]string{cfg, cfg}, lntest.OpenChannelParams{
Amt: btcutil.Amount(1000000),
})
chanPoint := ht.OpenChannel(bob, alice, lntest.OpenChannelParams{
Amt: btcutil.Amount(1000000),
})
alice, bob := nodes[0], nodes[1]
chanPoint := chanPoints[0]
res := alice.RPC.Quiesce(&devrpc.QuiescenceRequest{
ChanId: chanPoint,