context position fixup

This commit is contained in:
William Banfield
2022-01-20 17:35:05 -05:00
parent b18d06bd42
commit e2ec93350e
16 changed files with 43 additions and 43 deletions

View File

@@ -122,7 +122,7 @@ func TestClient(t *testing.T) {
t.Run("SequentialVerification", func(t *testing.T) {
newKeys := genPrivKeys(4)
newVals := newKeys.ToValidators(10, 1)
differentVals, _ := factory.ValidatorSet(t, ctx, 10, 100)
differentVals, _ := factory.ValidatorSet(ctx, t, 10, 100)
testCases := []struct {
name string
@@ -940,7 +940,7 @@ func TestClient(t *testing.T) {
logger := log.NewTestingLogger(t)
differentVals, _ := factory.ValidatorSet(t, ctx, 10, 100)
differentVals, _ := factory.ValidatorSet(ctx, t, 10, 100)
mockBadValSetNode := mockNodeFromHeadersAndVals(
map[int64]*types.SignedHeader{
1: h1,

View File

@@ -33,7 +33,7 @@ func TestLast_FirstLightBlockHeight(t *testing.T) {
assert.EqualValues(t, -1, height)
// 1 key
err = dbStore.SaveLightBlock(randLightBlock(t, ctx, int64(1)))
err = dbStore.SaveLightBlock(randLightBlock(ctx, t, int64(1)))
require.NoError(t, err)
height, err = dbStore.LastLightBlockHeight()
@@ -56,7 +56,7 @@ func Test_SaveLightBlock(t *testing.T) {
assert.Nil(t, h)
// 1 key
err = dbStore.SaveLightBlock(randLightBlock(t, ctx, 1))
err = dbStore.SaveLightBlock(randLightBlock(ctx, t, 1))
require.NoError(t, err)
size := dbStore.Size()
@@ -87,7 +87,7 @@ func Test_LightBlockBefore(t *testing.T) {
_, _ = dbStore.LightBlockBefore(100)
})
err := dbStore.SaveLightBlock(randLightBlock(t, ctx, int64(2)))
err := dbStore.SaveLightBlock(randLightBlock(ctx, t, int64(2)))
require.NoError(t, err)
h, err := dbStore.LightBlockBefore(3)
@@ -111,7 +111,7 @@ func Test_Prune(t *testing.T) {
require.NoError(t, err)
// One header
err = dbStore.SaveLightBlock(randLightBlock(t, ctx, 2))
err = dbStore.SaveLightBlock(randLightBlock(ctx, t, 2))
require.NoError(t, err)
assert.EqualValues(t, 1, dbStore.Size())
@@ -126,7 +126,7 @@ func Test_Prune(t *testing.T) {
// Multiple headers
for i := 1; i <= 10; i++ {
err = dbStore.SaveLightBlock(randLightBlock(t, ctx, int64(i)))
err = dbStore.SaveLightBlock(randLightBlock(ctx, t, int64(i)))
require.NoError(t, err)
}
@@ -151,7 +151,7 @@ func Test_Concurrency(t *testing.T) {
go func(i int64) {
defer wg.Done()
err := dbStore.SaveLightBlock(randLightBlock(t, ctx, i))
err := dbStore.SaveLightBlock(randLightBlock(ctx, t, i))
require.NoError(t, err)
_, err = dbStore.LightBlock(i)
@@ -194,9 +194,9 @@ func Test_Concurrency(t *testing.T) {
wg.Wait()
}
func randLightBlock(t *testing.T, ctx context.Context, height int64) *types.LightBlock {
func randLightBlock(ctx context.Context, t *testing.T, height int64) *types.LightBlock {
t.Helper()
vals, _ := factory.ValidatorSet(t, ctx, 2, 1)
vals, _ := factory.ValidatorSet(ctx, t, 2, 1)
return &types.LightBlock{
SignedHeader: &types.SignedHeader{
Header: &types.Header{