Skip to content

Commit

Permalink
lint: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Teja2045 committed Sep 19, 2024
1 parent a5fdb21 commit 6d671b4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions relayer/avail/light_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
// - HttpClient: An HTTP client handler used for making requests to the Avail light client.
// - LightClientURL: The URL of the Avail light client that this module communicates with.
type LightClient struct {
HTTPClient *http_client.HTTPClientHandler
HTTPClient *http_client.Handler
LightClientURL string
}

func NewLightClient(lightClientURL string, httpClient *http_client.HTTPClientHandler) *LightClient {
func NewLightClient(lightClientURL string, httpClient *http_client.Handler) *LightClient {
return &LightClient{
HTTPClient: httpClient,
LightClientURL: lightClientURL,
Expand Down
10 changes: 5 additions & 5 deletions relayer/http/http_client_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import (
)

// HTTPClientHandler struct
type HTTPClientHandler struct {
type Handler struct {
client *http.Client
}

// NewHTTPClientHandler creates a new HTTPClientHandler with default settings
func NewHTTPClientHandler() *HTTPClientHandler {
return &HTTPClientHandler{
func NewHTTPClientHandler() *Handler {
return &Handler{
client: &http.Client{
Timeout: 100 * time.Second,
},
}
}

// Get method
func (h *HTTPClientHandler) Get(url string) ([]byte, error) {
func (h *Handler) Get(url string) ([]byte, error) {
resp, err := h.client.Get(url)
if err != nil {
return nil, fmt.Errorf("GET request error: %v", err)
Expand All @@ -38,7 +38,7 @@ func (h *HTTPClientHandler) Get(url string) ([]byte, error) {
}

// Post method
func (h *HTTPClientHandler) Post(url string, jsonData []byte) ([]byte, error) {
func (h *Handler) Post(url string, jsonData []byte) ([]byte, error) {
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
return nil, fmt.Errorf("error creating request: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion relayer/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (r *Relayer) postBlocks(ctx sdk.Context, blocks []int64, cdc codec.BinaryCo

bb := r.GetBlocksDataFromLocal(ctx, blocks)

blockInfo, err := r.SubmitDataToAvailClient(bb, blocks, r.AvailConfig.LightClientURL)
blockInfo, err := r.SubmitDataToAvailClient(bb, blocks)
if err != nil {
r.logger.Error("Error while submitting block(s) to Avail DA",
"height_start", blocks[0],
Expand Down
2 changes: 1 addition & 1 deletion relayer/submit_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/vitwit/avail-da-module/relayer/avail"
)

func (r *Relayer) SubmitDataToAvailClient(data []byte, blocks []int64, lightClientURL string) (avail.BlockMetaData, error) {
func (r *Relayer) SubmitDataToAvailClient(data []byte, blocks []int64) (avail.BlockMetaData, error) {

blockInfo, err := r.availDAClient.Submit(data)

Expand Down

0 comments on commit 6d671b4

Please sign in to comment.