Skip to content

Commit

Permalink
fix(tests): Correct misleading variable names and expressions in test…
Browse files Browse the repository at this point in the history
… files (#14292)

Co-authored-by: Radosław Kapka <[email protected]>
  • Loading branch information
syjn99 and rkapka authored Aug 2, 2024
1 parent 85f334b commit ff3e085
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) {

ctx := context.Background()
slot := primitives.Slot(0)
epochs := 10
epochs := primitives.Epoch(10)
numVals := uint64(10)

beaconDB := dbTest.SetupDB(t)
Expand Down Expand Up @@ -1065,7 +1065,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) {
}
res, err := bs.ListValidators(context.Background(), req)
require.NoError(t, err)
assert.Equal(t, epochs, len(res.ValidatorList))
assert.Equal(t, int(numVals), len(res.ValidatorList))

vals := st.Validators()
want := make([]*ethpb.Validators_ValidatorContainer, 0)
Expand All @@ -1077,7 +1077,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) {
}
req = &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Epoch{
Epoch: 10,
Epoch: epochs,
},
}
res, err = bs.ListValidators(context.Background(), req)
Expand Down
16 changes: 8 additions & 8 deletions beacon-chain/state/state-native/proofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ func TestBeaconStateMerkleProofs_altair(t *testing.T) {
t.Run("current sync committee", func(t *testing.T) {
cscp, err := altair.CurrentSyncCommitteeProof(ctx)
require.NoError(t, err)
require.Equal(t, len(cscp), 5)
require.Equal(t, 5, len(cscp))
for i, bytes := range cscp {
require.Equal(t, hexutil.Encode(bytes), results[i])
require.Equal(t, results[i], hexutil.Encode(bytes))
}
})
t.Run("next sync committee", func(t *testing.T) {
nscp, err := altair.NextSyncCommitteeProof(ctx)
require.NoError(t, err)
require.Equal(t, len(nscp), 5)
require.Equal(t, 5, len(nscp))
for i, bytes := range nscp {
require.Equal(t, hexutil.Encode(bytes), results[i])
require.Equal(t, results[i], hexutil.Encode(bytes))
}
})
t.Run("finalized root", func(t *testing.T) {
Expand Down Expand Up @@ -112,17 +112,17 @@ func TestBeaconStateMerkleProofs_bellatrix(t *testing.T) {
t.Run("current sync committee", func(t *testing.T) {
cscp, err := bellatrix.CurrentSyncCommitteeProof(ctx)
require.NoError(t, err)
require.Equal(t, len(cscp), 5)
require.Equal(t, 5, len(cscp))
for i, bytes := range cscp {
require.Equal(t, hexutil.Encode(bytes), results[i])
require.Equal(t, results[i], hexutil.Encode(bytes))
}
})
t.Run("next sync committee", func(t *testing.T) {
nscp, err := bellatrix.NextSyncCommitteeProof(ctx)
require.NoError(t, err)
require.Equal(t, len(nscp), 5)
require.Equal(t, 5, len(nscp))
for i, bytes := range nscp {
require.Equal(t, hexutil.Encode(bytes), results[i])
require.Equal(t, results[i], hexutil.Encode(bytes))
}
})
t.Run("finalized root", func(t *testing.T) {
Expand Down

0 comments on commit ff3e085

Please sign in to comment.