Skip to content

Commit

Permalink
Update for loops over integers with range round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
KaloyanTanev committed Jul 19, 2024
1 parent bc4c1ba commit 6a10c5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/obolapi/exit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestAPIFlow(t *testing.T) {
sigData, err := (&eth2p0.SigningData{ObjectRoot: sigRoot, Domain: domain}).HashTreeRoot()
require.NoError(t, err)

for idx := 0; idx < len(shares); idx++ {
for idx := range len(shares) {
var exits []obolapi.ExitBlob

for _, shareSet := range shares[idx] {
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestAPIFlowMissingSig(t *testing.T) {
sigData, err := (&eth2p0.SigningData{ObjectRoot: sigRoot, Domain: domain}).HashTreeRoot()
require.NoError(t, err)

for idx := 0; idx < len(shares); idx++ {
for idx := range len(shares) {
var exits []obolapi.ExitBlob

for _, shareSet := range shares[idx] {
Expand Down
4 changes: 2 additions & 2 deletions cmd/combine/combine.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func Combine(ctx context.Context, inputDir, outputDir string, force, noverify bo

var combinedKeys []tbls.PrivateKey

for valIdx := 0; valIdx < len(privkeys); valIdx++ {
for valIdx := range len(privkeys) {
pkSet := privkeys[valIdx]

if len(pkSet) < int(cluster.Threshold) {
Expand Down Expand Up @@ -178,7 +178,7 @@ func Combine(ctx context.Context, inputDir, outputDir string, force, noverify bo
func shareIdxByPubkeys(cluster *manifestpb.Cluster, secrets []tbls.PrivateKey, valIndex int) (map[int]tbls.PrivateKey, error) {
pubkMap := make(map[tbls.PublicKey]int)

for peerIdx := 0; peerIdx < len(cluster.Validators[valIndex].PubShares); peerIdx++ {
for peerIdx := range len(cluster.GetValidators()[valIndex].GetPubShares()) {
pubShareRaw := cluster.Validators[valIndex].GetPubShares()[peerIdx]

pubShare, err := tblsconv.PubkeyFromBytes(pubShareRaw)
Expand Down

0 comments on commit 6a10c5f

Please sign in to comment.