multi: update linter, fix new issues

This commit is contained in:
Oliver Gugger committed 2023-06-13 11:58:33 +02:00
1 parent e549096b88
commit 56dba2df03
31 files changed
+263 -301

No files matched your search

+1 -15
View File
@@ -315,7 +315,6 @@ func testChannelBackupRestoreBasic(ht *lntest.HarnessTest) {
"dave", nil, password, mnemonic,
"", revocationWindow,
backupSnapshot,
copyPorts(oldNode),
)
}
},
@@ -347,7 +346,6 @@ func testChannelBackupRestoreBasic(ht *lntest.HarnessTest) {
newNode := st.RestoreNodeWithSeed(
"dave", nil, password, mnemonic,
"", revocationWindow, nil,
copyPorts(oldNode),
)
st.RestartNodeWithChanBackups(
newNode, backupSnapshot,
@@ -386,7 +384,6 @@ func testChannelBackupRestoreBasic(ht *lntest.HarnessTest) {
newNode := st.RestoreNodeWithSeed(
"dave", nil, password, mnemonic,
"", revocationWindow, nil,
copyPorts(oldNode),
)
req := &lnrpc.RestoreChanBackupRequest{
@@ -1367,7 +1364,7 @@ func chanRestoreViaRPC(ht *lntest.HarnessTest, password []byte,
return func() *node.HarnessNode {
newNode := ht.RestoreNodeWithSeed(
"dave", nil, password, mnemonic, "", revocationWindow,
nil, copyPorts(oldNode),
nil,
)
req := &lnrpc.RestoreChanBackupRequest{Backup: backup}
newNode.RPC.RestoreChanBackups(req)
@@ -1376,17 +1373,6 @@ func chanRestoreViaRPC(ht *lntest.HarnessTest, password []byte,
}
}
// copyPorts returns a node option function that copies the ports of an existing
// node over to the newly created one.
func copyPorts(oldNode *node.HarnessNode) node.Option {
return func(cfg *node.BaseNodeConfig) {
cfg.P2PPort = oldNode.Cfg.P2PPort
cfg.RPCPort = oldNode.Cfg.RPCPort
cfg.RESTPort = oldNode.Cfg.RESTPort
cfg.ProfilePort = oldNode.Cfg.ProfilePort
}
}
// assertTimeLockSwept when dave's outputs matures, he should claim them. This
// function will advance 2 blocks such that all the pending closing
// transactions would be swept in the end.
+3 -5
View File
@@ -173,8 +173,7 @@ func testChannelFundMax(ht *lntest.HarnessTest) {
success := ht.Run(
testCase.name, func(tt *testing.T) {
runFundMaxTestCase(
ht, tt, alice, bob, testCase,
reserveAmount,
ht, alice, bob, testCase, reserveAmount,
)
},
)
@@ -188,9 +187,8 @@ func testChannelFundMax(ht *lntest.HarnessTest) {
}
// runTestCase runs a single test case asserting that test conditions are met.
func runFundMaxTestCase(ht *lntest.HarnessTest, t *testing.T, alice,
bob *node.HarnessNode, testCase *chanFundMaxTestCase,
reserveAmount btcutil.Amount) {
func runFundMaxTestCase(ht *lntest.HarnessTest, alice, bob *node.HarnessNode,
testCase *chanFundMaxTestCase, reserveAmount btcutil.Amount) {
ht.FundCoins(testCase.initialWalletBalance, alice)
+1 -2
View File
@@ -77,12 +77,11 @@ func testEtcdFailoverCase(ht *lntest.HarnessTest, kill bool) {
require.NoError(ht, err, "Cannot start election observer")
password := []byte("the quick brown fox jumps the lazy dog")
entropy := [16]byte{1, 2, 3}
stateless := false
cluster := true
carol1, _, _ := ht.NewNodeWithSeedEtcd(
"Carol-1", etcdCfg, password, entropy[:], stateless, cluster,
"Carol-1", etcdCfg, password, stateless, cluster,
leaderSessionTTL,
)
info1 := carol1.RPC.GetInfo()
+1 -1
View File
@@ -77,7 +77,7 @@ func testResHandoff(ht *lntest.HarnessTest) {
// Mine blocks until Bob has no waiting close channels. This tests that
// the circuit-deletion logic is skipped if a resolution message
// exists.
ht.CleanupForceClose(bob, chanPointCarol)
ht.CleanupForceClose(bob)
// We will now restart Bob so that we can test whether the resolution
// messages are re-forwarded on start-up.
-2
View File
@@ -480,8 +480,6 @@ func testSendToRouteErrorPropagation(ht *lntest.HarnessTest) {
// testPrivateChannels tests that a private channel can be used for
// routing by the two endpoints of the channel, but is not known by
// the rest of the nodes in the graph.
//
//nolint:dupword
func testPrivateChannels(ht *lntest.HarnessTest) {
const chanAmt = btcutil.Amount(100000)
+1 -1
View File
@@ -118,5 +118,5 @@ func testWipeForwardingPackages(ht *lntest.HarnessTest) {
ht.MineBlocksAndAssertNumTxes(1, 1)
// Clean up the force closed channel.
ht.CleanupForceClose(bob, chanPointAB)
ht.CleanupForceClose(bob)
}