Skip to content

Commit 48d7101

Browse files
authored
Merge pull request #330 from multiversx/update-spica-patch
Update spica patch
2 parents 345ad47 + b8ee110 commit 48d7101

File tree

92 files changed

+1826
-1515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1826
-1515
lines changed

.github/workflows/pr-integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Run integration tests with Elasticsearch `v7.17.8`
4545
run: make integration-tests ES_VERSION=7.17.8
4646
test-2:
47-
name: Elasticsearch v8.6.0
47+
name: Elasticsearch v8.16.0
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Set up Go 1.x
@@ -59,8 +59,8 @@ jobs:
5959
- name: Get dependencies
6060
run: |
6161
go get -v -t -d ./...
62-
- name: Run integration tests with Elasticsearch `v8.6.0`
63-
run: make integration-tests ES_VERSION=8.6.0
62+
- name: Run integration tests with Elasticsearch `v8.16.0`
63+
run: make integration-tests ES_VERSION=8.16.0
6464
test-3:
6565
name: OpenSearch v1.3.7
6666
runs-on: ubuntu-latest

client/elasticClient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (ec *elasticClient) createPolicy(policyName string, policy *bytes.Buffer) e
329329

330330
// CreateIndexTemplate creates an elasticsearch index template
331331
func (ec *elasticClient) createIndexTemplate(templateName string, template io.Reader) error {
332-
res, err := ec.client.Indices.PutTemplate(templateName, template, ec.client.Indices.PutTemplate.WithContext(context.Background()))
332+
res, err := ec.client.Indices.PutIndexTemplate(templateName, template)
333333
if err != nil {
334334
return err
335335
}

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
// to be saved for a block. It has all the default fields
1010
// plus some extra information for ease of search and filter
1111
type Block struct {
12+
UUID string `json:"uuid"`
1213
Nonce uint64 `json:"nonce"`
1314
Round uint64 `json:"round"`
1415
Epoch uint32 `json:"epoch"`

data/event.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "time"
44

55
// LogEvent is the dto for the log event structure
66
type LogEvent struct {
7+
UUID string `json:"uuid"`
78
ID string `json:"-"`
89
TxHash string `json:"txHash"`
910
OriginalTxHash string `json:"originalTxHash,omitempty"`

data/logs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
// Logs holds all the fields needed for a logs structure
1111
type Logs struct {
12+
UUID string `json:"uuid"`
1213
ID string `json:"-"`
1314
OriginalTxHash string `json:"originalTxHash,omitempty"`
1415
Address string `json:"address"`

data/scresult.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "time"
44

55
// ScResult is a structure containing all the fields that need to be saved for a smart contract result
66
type ScResult struct {
7+
UUID string `json:"uuid"`
78
Hash string `json:"-"`
89
MBHash string `json:"miniBlockHash,omitempty"`
910
Nonce uint64 `json:"nonce"`
@@ -39,6 +40,7 @@ type ScResult struct {
3940
CanBeIgnored bool `json:"canBeIgnored,omitempty"`
4041
OriginalSender string `json:"originalSender,omitempty"`
4142
HasLogs bool `json:"hasLogs,omitempty"`
43+
Epoch uint32 `json:"epoch"`
4244
ExecutionOrder int `json:"-"`
4345
SenderAddressBytes []byte `json:"-"`
4446
InitialTxGasUsed uint64 `json:"-"`

0 commit comments

Comments
 (0)