Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/elasticClientCommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func loadResponseBody(body io.ReadCloser, dest interface{}) error {
return nil
}
if dest == nil {
_, err := io.Copy(ioutil.Discard, body)
_, err := io.Copy(io.Discard, body)
return err
}

Expand All @@ -56,7 +56,7 @@ func loadResponseBody(body io.ReadCloser, dest interface{}) error {

func elasticDefaultErrorResponseHandler(res *esapi.Response) error {
responseBody := map[string]interface{}{}
bodyBytes, err := ioutil.ReadAll(res.Body)
bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
return fmt.Errorf("%w cannot read elastic response body bytes", err)
}
Expand Down
7 changes: 2 additions & 5 deletions client/elasticClientScroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"strconv"
"time"
Expand All @@ -23,9 +23,6 @@ func (ec *elasticClient) DoCountRequest(ctx context.Context, index string, body
if err != nil {
return 0, err
}
if err != nil {
return 0, err
}

bodyBytes, err := getBytesFromResponse(res)
if err != nil {
Expand Down Expand Up @@ -139,7 +136,7 @@ func getBytesFromResponse(res *esapi.Response) ([]byte, error) {
}
defer closeBody(res)

bodyBytes, err := ioutil.ReadAll(res.Body)
bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions client/elasticClientScroll_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"context"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"os"
Expand All @@ -24,7 +24,7 @@ func TestElasticClient_DoCountRequest(t *testing.T) {
jsonFile, err := os.Open("./testsData/response-count-request.json")
require.Nil(t, err)

byteValue, _ := ioutil.ReadAll(jsonFile)
byteValue, _ := io.ReadAll(jsonFile)
_, _ = w.Write(byteValue)
}

Expand Down
5 changes: 2 additions & 3 deletions client/logging/customLogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logging

import (
"io"
"io/ioutil"
"net/http"
"time"

Expand All @@ -28,10 +27,10 @@ func (cl *CustomLogger) LogRoundTrip(
)

if req != nil && req.Body != nil && req.Body != http.NoBody {
reqSize, _ = io.Copy(ioutil.Discard, req.Body)
reqSize, _ = io.Copy(io.Discard, req.Body)
}
if res != nil && res.Body != nil && res.Body != http.NoBody {
resSize, _ = io.Copy(ioutil.Discard, res.Body)
resSize, _ = io.Copy(io.Discard, res.Body)
}

if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion data/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/data/api"
)

// Block is a structure containing all the fields that need
Expand All @@ -18,7 +20,7 @@ type Block struct {
MiniBlocksDetails []*MiniBlocksDetails `json:"miniBlocksDetails,omitempty"`
NotarizedBlocksHashes []string `json:"notarizedBlocksHashes"`
Proposer uint64 `json:"proposer"`
Validators []uint64 `json:"validators"`
Validators []uint64 `json:"validators,omitempty"`
PubKeyBitmap string `json:"pubKeyBitmap"`
Size int64 `json:"size"`
SizeTxs int64 `json:"sizeTxs"`
Expand All @@ -39,6 +41,7 @@ type Block struct {
MaxGasLimit uint64 `json:"maxGasLimit"`
ScheduledData *ScheduledData `json:"scheduledData,omitempty"`
EpochStartShardsData []*EpochStartShardData `json:"epochStartShardsData,omitempty"`
Proof *api.HeaderProof `json:"proof,omitempty"`
RandSeed string `json:"randSeed,omitempty"`
PrevRandSeed string `json:"prevRandSeed,omitempty"`
Signature string `json:"signature,omitempty"`
Expand All @@ -47,6 +50,7 @@ type Block struct {
SoftwareVersion string `json:"softwareVersion,omitempty"`
ReceiptsHash string `json:"receiptsHash,omitempty"`
Reserved []byte `json:"reserved,omitempty"`
ProposerBlsKey string `json:"proposerBlsKey,omitempty"`
}

// MiniBlocksDetails is a structure that hold information about mini-blocks execution details
Expand Down
37 changes: 19 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,56 @@ go 1.23
require (
github.com/elastic/go-elasticsearch/v7 v7.12.0
github.com/gin-contrib/cors v1.4.0
github.com/gin-gonic/gin v1.9.1
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
github.com/multiversx/mx-chain-communication-go v1.1.2-0.20250218164645-1f6964baffbe
github.com/multiversx/mx-chain-core-go v1.2.25-0.20250218161123-121084ae9840
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250218161408-6a0c19d0da48
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250218162215-88938774627c
github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250520075408-c94bee9ee163
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.62.0
github.com/stretchr/testify v1.10.0
github.com/tidwall/gjson v1.14.0
github.com/urfave/cli v1.22.10
github.com/tidwall/gjson v1.18.0
github.com/urfave/cli v1.22.16
google.golang.org/protobuf v1.36.4
)

require (
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.30.0 // indirect
Expand Down
Loading
Loading