mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
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:
@@ -3,7 +3,6 @@ package rpc
|
||||
import (
|
||||
"archive/zip"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -37,7 +36,7 @@ var (
|
||||
)
|
||||
|
||||
func TestServer_ListAccounts(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
localWalletDir := setupWalletDir(t)
|
||||
defaultWalletPath = localWalletDir
|
||||
// We attempt to create the wallet.
|
||||
@@ -142,7 +141,7 @@ func TestServer_ListAccounts(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServer_BackupAccounts(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
localWalletDir := setupWalletDir(t)
|
||||
defaultWalletPath = localWalletDir
|
||||
// We attempt to create the wallet.
|
||||
@@ -235,7 +234,7 @@ func TestServer_BackupAccounts(t *testing.T) {
|
||||
func TestServer_VoluntaryExit(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
mockValidatorClient := validatormock.NewMockValidatorClient(ctrl)
|
||||
mockNodeClient := validatormock.NewMockNodeClient(ctrl)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user