lntest+itest: fix testUpdateChanStatus

This commit is contained in:
yyforyongyu 2024-10-24 23:23:59 +08:00
parent d27ff34b04
commit 7dd9a17625
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -42,25 +42,23 @@ import (
// thus a following operation will fail if it relies on the channel being
// enabled.
func testUpdateChanStatus(ht *lntest.HarnessTest) {
// Create two fresh nodes and open a channel between them.
alice, bob := ht.Alice, ht.Bob
args := []string{
// Prepare params.
chanAmt := btcutil.Amount(100_000)
openChannelParams := lntest.OpenChannelParams{
Amt: chanAmt,
}
cfg := []string{
"--minbackoff=60s",
"--chan-enable-timeout=3s",
"--chan-disable-timeout=6s",
"--chan-status-sample-interval=0.5s",
}
ht.RestartNodeWithExtraArgs(alice, args)
ht.RestartNodeWithExtraArgs(bob, args)
ht.EnsureConnected(alice, bob)
cfgs := [][]string{cfg, cfg}
// Open a channel with 100k satoshis between Alice and Bob with Alice
// being the sole funder of the channel.
chanAmt := btcutil.Amount(100000)
chanPoint := ht.OpenChannel(
alice, bob, lntest.OpenChannelParams{Amt: chanAmt},
)
defer ht.CloseChannel(alice, chanPoint)
// Create two fresh nodes and open a channel between them.
chanPoints, nodes := ht.CreateSimpleNetwork(cfgs, openChannelParams)
chanPoint := chanPoints[0]
alice, bob := nodes[0], nodes[1]
// assertEdgeDisabled ensures that Alice has the correct Disabled state
// for given channel from her DescribeGraph.