multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings. This change was produced by: - running golangci-lint run --fix - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go` - manually fixing broken tests - itest, lntest: use ht.Context() where ht or hn is available - in HarnessNode.Stop() we keep using context.Background(), because it is called from a cleanup handler in which t.Context() is canceled already.
This commit is contained in:
71 files changed
+361
-393
No files matched your search
@@ -2,7 +2,6 @@ package itest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -500,7 +499,7 @@ func runSignVerifyMessage(ht *lntest.HarnessTest, alice *node.HarnessNode) {
|
||||
|
||||
expectedErr := "tag can only be used when the Schnorr signature " +
|
||||
"option is set"
|
||||
ctxt := context.Background()
|
||||
ctxt := ht.Context()
|
||||
_, err := alice.RPC.Signer.SignMessage(ctxt, signMsgReq)
|
||||
require.ErrorContains(ht, err, expectedErr)
|
||||
|
||||
|
||||
Reference in new issue
Block a user