Skip to content

Commit

Permalink
refactor: Simplify variable naming in eth service functions
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Oct 23, 2024
1 parent e6510a7 commit 8544efd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/service/eth/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ func (h *Handler) LightClientBootstrap(ctx context.Context, root phase0.Root) (*
return nil, "", fmt.Errorf("version not found")
}

version, ok := v.(string)
ver, ok := v.(string)
if !ok {
return nil, "", fmt.Errorf("version is not a string")
}

return rsp.Data, version, nil
return rsp.Data, ver, nil
}

// LightClientFinalityUpdate returns the light client finality update.
Expand All @@ -631,12 +631,12 @@ func (h *Handler) LightClientFinalityUpdate(ctx context.Context) (*lightclient.F
return nil, "", fmt.Errorf("version not found")
}

version, ok := v.(string)
ver, ok := v.(string)
if !ok {
return nil, "", fmt.Errorf("version is not a string")
}

return rsp.Data, version, nil
return rsp.Data, ver, nil
}

// LightClientOptimisticUpdate returns the light client optimistic update.
Expand All @@ -663,12 +663,12 @@ func (h *Handler) LightClientOptimisticUpdate(ctx context.Context) (*lightclient
return nil, "", fmt.Errorf("version not found")
}

version, ok := v.(string)
ver, ok := v.(string)
if !ok {
return nil, "", fmt.Errorf("version is not a string")
}

return rsp.Data, version, nil
return rsp.Data, ver, nil
}

// LightClientUpdates returns the light client updates.
Expand All @@ -695,10 +695,10 @@ func (h *Handler) LightClientUpdates(ctx context.Context, startPeriod, count int
return nil, "", fmt.Errorf("version not found")
}

version, ok := v.(string)
ver, ok := v.(string)
if !ok {
return nil, "", fmt.Errorf("version is not a string")
}

return rsp.Data, version, nil
return rsp.Data, ver, nil
}

0 comments on commit 8544efd

Please sign in to comment.