From fadd16985e5c08a9ab9a32ee0ee8cce2903615d1 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 20 Jan 2022 17:37:34 -0500 Subject: [PATCH] ctx fixup continued --- internal/evidence/verify_test.go | 5 ++--- light/client_test.go | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/evidence/verify_test.go b/internal/evidence/verify_test.go index 159cc7518..bcc008aee 100644 --- a/internal/evidence/verify_test.go +++ b/internal/evidence/verify_test.go @@ -294,11 +294,10 @@ func TestVerifyLightClientAttack_Equivocation(t *testing.T) { } func TestVerifyLightClientAttack_Amnesia(t *testing.T) { - var height int64 = 10 - conflictingVals, conflictingPrivVals := factory.ValidatorSet(ctx, t, 5, 10) - ctx, cancel := context.WithCancel(context.Background()) defer cancel() + var height int64 = 10 + conflictingVals, conflictingPrivVals := factory.ValidatorSet(ctx, t, 5, 10) conflictingHeader := factory.MakeHeader(t, &types.Header{ ChainID: evidenceChainID, diff --git a/light/client_test.go b/light/client_test.go index 352b38b60..bc585f7b8 100644 --- a/light/client_test.go +++ b/light/client_test.go @@ -37,6 +37,8 @@ func init() { } func TestClient(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() var ( keys = genPrivKeys(4) vals = keys.ToValidators(20, 10)