Replace context.Background with testing.TB.Context where possible (#15416)

* Replace context.Background with testing.TB.Context where possible

* Fix failing tests
This commit is contained in:
Preston Van Loon
2025-06-16 17:09:18 -05:00
committed by GitHub
parent 6a13ba9125
commit 62fec4d1f3
409 changed files with 3175 additions and 3456 deletions

View File

@@ -3,6 +3,9 @@ package historycmd
import (
"encoding/json"
"flag"
"path/filepath"
"testing"
"github.com/OffchainLabs/prysm/v6/cmd"
"github.com/OffchainLabs/prysm/v6/cmd/validator/flags"
"github.com/OffchainLabs/prysm/v6/io/file"
@@ -13,8 +16,6 @@ import (
"github.com/OffchainLabs/prysm/v6/validator/slashing-protection-history/format"
mocks "github.com/OffchainLabs/prysm/v6/validator/testing"
"github.com/urfave/cli/v2"
"path/filepath"
"testing"
)
func setupCliCtx(

View File

@@ -1,7 +1,6 @@
package wallet
import (
"context"
"flag"
"os"
"path/filepath"
@@ -72,7 +71,7 @@ func TestRecoverDerivedWallet(t *testing.T) {
cliCtx := createRecoverCliCtx(t, cfg)
require.NoError(t, walletRecover(cliCtx))
ctx := context.Background()
ctx := t.Context()
w, err := wallet.OpenWallet(cliCtx.Context, &wallet.Config{
WalletDir: cfg.walletDir,
WalletPassword: password,