mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 14:10:35 +02:00
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:
@@ -2,7 +2,6 @@ package paymentsdb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"math"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -932,7 +931,7 @@ func TestQueryPayments(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
paymentDB := NewKVTestDB(t)
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package paymentsdb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
@@ -304,7 +303,7 @@ func assertDBPayments(t *testing.T, paymentDB DB, payments []*payment) {
|
||||
t.Helper()
|
||||
|
||||
response, err := paymentDB.QueryPayments(
|
||||
context.Background(), Query{
|
||||
t.Context(), Query{
|
||||
IndexOffset: 0,
|
||||
MaxPayments: uint64(len(payments)),
|
||||
IncludeIncomplete: true,
|
||||
|
Reference in New Issue
Block a user