Skip to content

Commit 3273178

Browse files
authored
Merge pull request #341 from multiversx/andromeda-to-barnard
Andromeda to barnard
2 parents fb99b9b + 09915e4 commit 3273178

File tree

14 files changed

+170
-120
lines changed

14 files changed

+170
-120
lines changed

client/elasticClientCommon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func loadResponseBody(body io.ReadCloser, dest interface{}) error {
4646
return nil
4747
}
4848
if dest == nil {
49-
_, err := io.Copy(ioutil.Discard, body)
49+
_, err := io.Copy(io.Discard, body)
5050
return err
5151
}
5252

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

5757
func elasticDefaultErrorResponseHandler(res *esapi.Response) error {
5858
responseBody := map[string]interface{}{}
59-
bodyBytes, err := ioutil.ReadAll(res.Body)
59+
bodyBytes, err := io.ReadAll(res.Body)
6060
if err != nil {
6161
return fmt.Errorf("%w cannot read elastic response body bytes", err)
6262
}

client/elasticClientScroll.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
"strconv"
1010
"time"
@@ -23,9 +23,6 @@ func (ec *elasticClient) DoCountRequest(ctx context.Context, index string, body
2323
if err != nil {
2424
return 0, err
2525
}
26-
if err != nil {
27-
return 0, err
28-
}
2926

3027
bodyBytes, err := getBytesFromResponse(res)
3128
if err != nil {
@@ -139,7 +136,7 @@ func getBytesFromResponse(res *esapi.Response) ([]byte, error) {
139136
}
140137
defer closeBody(res)
141138

142-
bodyBytes, err := ioutil.ReadAll(res.Body)
139+
bodyBytes, err := io.ReadAll(res.Body)
143140
if err != nil {
144141
return nil, err
145142
}

client/elasticClientScroll_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package client
22

33
import (
44
"context"
5-
"io/ioutil"
5+
"io"
66
"net/http"
77
"net/http/httptest"
88
"os"
@@ -24,7 +24,7 @@ func TestElasticClient_DoCountRequest(t *testing.T) {
2424
jsonFile, err := os.Open("./testsData/response-count-request.json")
2525
require.Nil(t, err)
2626

27-
byteValue, _ := ioutil.ReadAll(jsonFile)
27+
byteValue, _ := io.ReadAll(jsonFile)
2828
_, _ = w.Write(byteValue)
2929
}
3030

client/logging/customLogger.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package logging
22

33
import (
44
"io"
5-
"io/ioutil"
65
"net/http"
76
"time"
87

@@ -28,10 +27,10 @@ func (cl *CustomLogger) LogRoundTrip(
2827
)
2928

3029
if req != nil && req.Body != nil && req.Body != http.NoBody {
31-
reqSize, _ = io.Copy(ioutil.Discard, req.Body)
30+
reqSize, _ = io.Copy(io.Discard, req.Body)
3231
}
3332
if res != nil && res.Body != nil && res.Body != http.NoBody {
34-
resSize, _ = io.Copy(ioutil.Discard, res.Body)
33+
resSize, _ = io.Copy(io.Discard, res.Body)
3534
}
3635

3736
if err != nil {

data/block.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package data
22

33
import (
44
"time"
5+
6+
"github.com/multiversx/mx-chain-core-go/data/api"
57
)
68

79
// Block is a structure containing all the fields that need
@@ -18,7 +20,7 @@ type Block struct {
1820
MiniBlocksDetails []*MiniBlocksDetails `json:"miniBlocksDetails,omitempty"`
1921
NotarizedBlocksHashes []string `json:"notarizedBlocksHashes"`
2022
Proposer uint64 `json:"proposer"`
21-
Validators []uint64 `json:"validators"`
23+
Validators []uint64 `json:"validators,omitempty"`
2224
PubKeyBitmap string `json:"pubKeyBitmap"`
2325
Size int64 `json:"size"`
2426
SizeTxs int64 `json:"sizeTxs"`
@@ -39,6 +41,7 @@ type Block struct {
3941
MaxGasLimit uint64 `json:"maxGasLimit"`
4042
ScheduledData *ScheduledData `json:"scheduledData,omitempty"`
4143
EpochStartShardsData []*EpochStartShardData `json:"epochStartShardsData,omitempty"`
44+
Proof *api.HeaderProof `json:"proof,omitempty"`
4245
RandSeed string `json:"randSeed,omitempty"`
4346
PrevRandSeed string `json:"prevRandSeed,omitempty"`
4447
Signature string `json:"signature,omitempty"`
@@ -47,6 +50,7 @@ type Block struct {
4750
SoftwareVersion string `json:"softwareVersion,omitempty"`
4851
ReceiptsHash string `json:"receiptsHash,omitempty"`
4952
Reserved []byte `json:"reserved,omitempty"`
53+
ProposerBlsKey string `json:"proposerBlsKey,omitempty"`
5054
}
5155

5256
// MiniBlocksDetails is a structure that hold information about mini-blocks execution details

go.mod

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,56 @@ go 1.23
55
require (
66
github.com/elastic/go-elasticsearch/v7 v7.12.0
77
github.com/gin-contrib/cors v1.4.0
8-
github.com/gin-gonic/gin v1.9.1
8+
github.com/gin-gonic/gin v1.10.0
99
github.com/google/uuid v1.6.0
10-
github.com/multiversx/mx-chain-communication-go v1.1.2-0.20250218164645-1f6964baffbe
11-
github.com/multiversx/mx-chain-core-go v1.2.25-0.20250218161123-121084ae9840
12-
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250218161408-6a0c19d0da48
13-
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250218162215-88938774627c
10+
github.com/multiversx/mx-chain-communication-go v1.2.1-0.20250520083403-3f2bad6d5476
11+
github.com/multiversx/mx-chain-core-go v1.3.2-0.20250520074139-18b645ad397a
12+
github.com/multiversx/mx-chain-logger-go v1.0.16-0.20250520074859-b2faf3c90273
13+
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20250520075408-c94bee9ee163
1414
github.com/prometheus/client_model v0.6.1
1515
github.com/prometheus/common v0.62.0
1616
github.com/stretchr/testify v1.10.0
17-
github.com/tidwall/gjson v1.14.0
18-
github.com/urfave/cli v1.22.10
17+
github.com/tidwall/gjson v1.18.0
18+
github.com/urfave/cli v1.22.16
1919
google.golang.org/protobuf v1.36.4
2020
)
2121

2222
require (
2323
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
24-
github.com/bytedance/sonic v1.9.1 // indirect
25-
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
26-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
24+
github.com/bytedance/sonic v1.11.6 // indirect
25+
github.com/bytedance/sonic/loader v0.1.1 // indirect
26+
github.com/cloudwego/base64x v0.1.4 // indirect
27+
github.com/cloudwego/iasm v0.2.0 // indirect
28+
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
2729
github.com/davecgh/go-spew v1.1.1 // indirect
2830
github.com/denisbrodbeck/machineid v1.0.1 // indirect
29-
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
31+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
3032
github.com/gin-contrib/sse v0.1.0 // indirect
3133
github.com/go-playground/locales v0.14.1 // indirect
3234
github.com/go-playground/universal-translator v0.18.1 // indirect
33-
github.com/go-playground/validator/v10 v10.14.0 // indirect
35+
github.com/go-playground/validator/v10 v10.20.0 // indirect
3436
github.com/goccy/go-json v0.10.2 // indirect
3537
github.com/gogo/protobuf v1.3.2 // indirect
3638
github.com/golang/protobuf v1.5.3 // indirect
3739
github.com/gorilla/mux v1.8.1 // indirect
3840
github.com/gorilla/websocket v1.5.3 // indirect
3941
github.com/json-iterator/go v1.1.12 // indirect
4042
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
41-
github.com/leodido/go-urn v1.2.4 // indirect
43+
github.com/leodido/go-urn v1.4.0 // indirect
4244
github.com/mattn/go-isatty v0.0.20 // indirect
4345
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4446
github.com/modern-go/reflect2 v1.0.2 // indirect
4547
github.com/mr-tron/base58 v1.2.0 // indirect
4648
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4749
github.com/pelletier/go-toml v1.9.3 // indirect
48-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
50+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
4951
github.com/pmezard/go-difflib v1.0.0 // indirect
50-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
51-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
52+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
5253
github.com/tidwall/match v1.1.1 // indirect
5354
github.com/tidwall/pretty v1.2.0 // indirect
5455
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
55-
github.com/ugorji/go/codec v1.2.11 // indirect
56-
golang.org/x/arch v0.3.0 // indirect
56+
github.com/ugorji/go/codec v1.2.12 // indirect
57+
golang.org/x/arch v0.8.0 // indirect
5758
golang.org/x/crypto v0.32.0 // indirect
5859
golang.org/x/net v0.34.0 // indirect
5960
golang.org/x/sys v0.30.0 // indirect

0 commit comments

Comments
 (0)