Skip to content

Commit

Permalink
Merge pull request #240 from multiversx/merge-rc-1.6-in-feat-metrics
Browse files Browse the repository at this point in the history
Merge rc 1.6 in feat metrics
  • Loading branch information
miiu96 authored Jul 27, 2023
2 parents ed1a10c + 337df6b commit e0d4f5e
Show file tree
Hide file tree
Showing 28 changed files with 211 additions and 190 deletions.
3 changes: 3 additions & 0 deletions data/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ const (
MaxESDTValueLength = 100
// MaxFieldLength defines the maximum length for a keyword field, approximating the maximum length of the keyword type.
MaxFieldLength = 30000

// MaxKeywordFieldLengthBeforeBase64Encoding defines the maximum length for a keyword field that will be base64 encoded
MaxKeywordFieldLengthBeforeBase64Encoding = 22500
)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/gin-contrib/cors v1.4.0
github.com/gin-gonic/gin v1.9.0
github.com/multiversx/mx-chain-communication-go v1.0.3
github.com/multiversx/mx-chain-core-go v1.2.10-0.20230719111700-ba37de156180
github.com/multiversx/mx-chain-core-go v1.2.12-0.20230725101425-a34bd6d3e3b9
github.com/multiversx/mx-chain-logger-go v1.0.11
github.com/multiversx/mx-chain-vm-common-go v1.4.1
github.com/prometheus/client_model v0.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ github.com/multiversx/mx-chain-communication-go v1.0.3/go.mod h1:7oTI77XfWmRWwVE
github.com/multiversx/mx-chain-core-go v1.1.30/go.mod h1:8gGEQv6BWuuJwhd25qqhCOZbBSv9mk+hLeKvinSaSMk=
github.com/multiversx/mx-chain-core-go v1.2.1/go.mod h1:8gGEQv6BWuuJwhd25qqhCOZbBSv9mk+hLeKvinSaSMk=
github.com/multiversx/mx-chain-core-go v1.2.5/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-core-go v1.2.10-0.20230719111700-ba37de156180 h1:SZkaCv6L/3EBEELkAr+F/HCCrYgia/OLVgFHFQSggJw=
github.com/multiversx/mx-chain-core-go v1.2.10-0.20230719111700-ba37de156180/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-core-go v1.2.12-0.20230725101425-a34bd6d3e3b9 h1:oa48Q+QpF/3LHVR0ug7eFENoIVKKZL9PfldABT9cL3A=
github.com/multiversx/mx-chain-core-go v1.2.12-0.20230725101425-a34bd6d3e3b9/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-crypto-go v1.2.6/go.mod h1:rOj0Rr19HTOYt9YTeym7RKxlHt91NXln3LVKjHKVmA0=
github.com/multiversx/mx-chain-logger-go v1.0.11 h1:DFsHa+sc5fKwhDR50I8uBM99RTDTEW68ESyr5ALRDwE=
github.com/multiversx/mx-chain-logger-go v1.0.11/go.mod h1:1srDkP0DQucWQ+rYfaq0BX2qLnULsUdRPADpYUTM6dA=
Expand Down
9 changes: 5 additions & 4 deletions integrationtests/testdata/updateNFT/token-after-add-uris.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions integrationtests/testdata/updateNFT/token-after-freeze.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions integrationtests/testdata/updateNFT/token.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions integrationtests/updateNFT_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package integrationtests

import (
"bytes"
"context"
"encoding/hex"
"encoding/json"
Expand All @@ -24,9 +25,10 @@ func TestNFTUpdateMetadata(t *testing.T) {
esClient, err := createESClient(esURL)
require.Nil(t, err)

bigUri := bytes.Repeat([]byte("a"), 50000)
esdtCreateData := &esdt.ESDigitalToken{
TokenMetaData: &esdt.MetaData{
URIs: [][]byte{[]byte("uri"), []byte("uri")},
URIs: [][]byte{[]byte("uri"), []byte("uri"), bigUri, bigUri, bigUri},
},
}
marshalizedCreate, _ := json.Marshal(esdtCreateData)
Expand Down Expand Up @@ -79,7 +81,7 @@ func TestNFTUpdateMetadata(t *testing.T) {
{
Address: decodeAddress(address),
Identifier: []byte(core.BuiltInFunctionESDTNFTAddURI),
Topics: [][]byte{[]byte("NFT-abcd"), big.NewInt(14).Bytes(), big.NewInt(0).Bytes(), []byte("uri1"), []byte("uri2")},
Topics: [][]byte{[]byte("NFT-abcd"), big.NewInt(14).Bytes(), big.NewInt(0).Bytes(), []byte("uri"), bigUri},
},
nil,
},
Expand All @@ -100,7 +102,7 @@ func TestNFTUpdateMetadata(t *testing.T) {
{
Address: decodeAddress(address),
Identifier: []byte(core.BuiltInFunctionESDTNFTAddURI),
Topics: [][]byte{[]byte("NFT-abcd"), big.NewInt(14).Bytes(), big.NewInt(0).Bytes(), []byte("uri1"), []byte("uri2")},
Topics: [][]byte{[]byte("NFT-abcd"), big.NewInt(14).Bytes(), big.NewInt(0).Bytes(), []byte("uri"), bigUri},
},
nil,
},
Expand Down
6 changes: 3 additions & 3 deletions mock/dbTransactionsHandlerStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// DBTransactionProcessorStub -
type DBTransactionProcessorStub struct {
PrepareTransactionsForDatabaseCalled func(body *block.Body, header coreData.HeaderHandler, pool *outport.TransactionPool) *data.PreparedResults
PrepareTransactionsForDatabaseCalled func(mbs []*block.MiniBlock, header coreData.HeaderHandler, pool *outport.TransactionPool) *data.PreparedResults
SerializeReceiptsCalled func(recs []*data.Receipt, buffSlice *data.BufferSlice, index string) error
SerializeScResultsCalled func(scrs []*data.ScResult, buffSlice *data.BufferSlice, index string) error
}
Expand All @@ -20,9 +20,9 @@ func (tps *DBTransactionProcessorStub) SerializeTransactionsFeeData(_ map[string
}

// PrepareTransactionsForDatabase -
func (tps *DBTransactionProcessorStub) PrepareTransactionsForDatabase(body *block.Body, header coreData.HeaderHandler, pool *outport.TransactionPool, _ bool, _ uint32) *data.PreparedResults {
func (tps *DBTransactionProcessorStub) PrepareTransactionsForDatabase(mbs []*block.MiniBlock, header coreData.HeaderHandler, pool *outport.TransactionPool, _ bool, _ uint32) *data.PreparedResults {
if tps.PrepareTransactionsForDatabaseCalled != nil {
return tps.PrepareTransactionsForDatabaseCalled(body, header, pool)
return tps.PrepareTransactionsForDatabaseCalled(mbs, header, pool)
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions mock/elasticProcessorStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type ElasticProcessorStub struct {
RemoveHeaderCalled func(header coreData.HeaderHandler) error
RemoveMiniblocksCalled func(header coreData.HeaderHandler, body *block.Body) error
RemoveTransactionsCalled func(header coreData.HeaderHandler, body *block.Body) error
SaveMiniblocksCalled func(header coreData.HeaderHandler, body *block.Body) error
SaveMiniblocksCalled func(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) error
SaveTransactionsCalled func(outportBlockWithHeader *outport.OutportBlockWithHeader) error
SaveValidatorsRatingCalled func(validatorsRating *outport.ValidatorsRating) error
SaveRoundsInfoCalled func(infos *outport.RoundsInfo) error
Expand Down Expand Up @@ -63,9 +63,9 @@ func (eim *ElasticProcessorStub) RemoveTransactions(header coreData.HeaderHandle
}

// SaveMiniblocks -
func (eim *ElasticProcessorStub) SaveMiniblocks(header coreData.HeaderHandler, body *block.Body) error {
func (eim *ElasticProcessorStub) SaveMiniblocks(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) error {
if eim.SaveMiniblocksCalled != nil {
return eim.SaveMiniblocksCalled(header, body)
return eim.SaveMiniblocksCalled(header, miniBlocks)
}
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion process/dataindexer/dataIndexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ func (di *dataIndexer) saveBlockData(outportBlock *outport.OutportBlock, header
return nil
}

err = di.elasticProcessor.SaveMiniblocks(header, outportBlock.BlockData.Body)
miniBlocks := append(outportBlock.BlockData.Body.MiniBlocks, outportBlock.BlockData.IntraShardMiniBlocks...)
err = di.elasticProcessor.SaveMiniblocks(header, miniBlocks)
if err != nil {
return fmt.Errorf("%w when saving miniblocks, block hash %s, nonce %d",
err, hex.EncodeToString(headerHash), headerNonce)
Expand Down
2 changes: 1 addition & 1 deletion process/dataindexer/dataIndexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestDataIndexer_SaveBlock(t *testing.T) {
countMap[0]++
return nil
},
SaveMiniblocksCalled: func(header coreData.HeaderHandler, body *dataBlock.Body) error {
SaveMiniblocksCalled: func(header coreData.HeaderHandler, miniBlocks []*dataBlock.MiniBlock) error {
countMap[1]++
return nil
},
Expand Down
2 changes: 1 addition & 1 deletion process/dataindexer/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ElasticProcessor interface {
RemoveMiniblocks(header coreData.HeaderHandler, body *block.Body) error
RemoveTransactions(header coreData.HeaderHandler, body *block.Body) error
RemoveAccountsESDT(headerTimestamp uint64, shardID uint32) error
SaveMiniblocks(header coreData.HeaderHandler, body *block.Body) error
SaveMiniblocks(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) error
SaveTransactions(outportBlockWithHeader *outport.OutportBlockWithHeader) error
SaveValidatorsRating(ratingData *outport.ValidatorsRating) error
SaveRoundsInfo(rounds *outport.RoundsInfo) error
Expand Down
10 changes: 10 additions & 0 deletions process/elasticproc/converters/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ func TruncateFieldIfExceedsMaxLength(field string) string {
return field
}

// TruncateFieldIfExceedsMaxLengthBase64 will truncate the provided field if the max length after base64 encoding would be exceeded
// this function will be used for the fields that after will be base64 encoded
func TruncateFieldIfExceedsMaxLengthBase64(field string) string {
if len(field) > data.MaxKeywordFieldLengthBeforeBase64Encoding {
return field[:data.MaxKeywordFieldLengthBeforeBase64Encoding]
}

return field
}

//TruncateSliceElementsIfExceedsMaxLength will truncate the provided slice of the field if the max length is exceeded
func TruncateSliceElementsIfExceedsMaxLength(fields []string) []string {
var localFields []string
Expand Down
15 changes: 10 additions & 5 deletions process/elasticproc/converters/tokenMetaData.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ func PrepareTokenMetaData(tokenMetadata *alteredAccount.TokenMetaData) *data.Tok

var uris [][]byte
for _, uri := range tokenMetadata.URIs {
truncatedURI := TruncateFieldIfExceedsMaxLength(string(uri))
truncatedURI := TruncateFieldIfExceedsMaxLengthBase64(string(uri))
uris = append(uris, []byte(truncatedURI))
}

tags := ExtractTagsFromAttributes(tokenMetadata.Attributes)
attributes := TruncateFieldIfExceedsMaxLength(string(tokenMetadata.Attributes))
attributes := TruncateFieldIfExceedsMaxLengthBase64(string(tokenMetadata.Attributes))
return &data.TokenMetaData{
Name: TruncateFieldIfExceedsMaxLength(tokenMetadata.Name),
Creator: tokenMetadata.Creator,
Expand Down Expand Up @@ -90,8 +90,9 @@ func PrepareNFTUpdateData(buffSlice *data.BufferSlice, updateNFTData []*data.NFT
return buffSlice.PutData(metaData, prepareSerializedDataForPauseAndUnPause(nftUpdate))
}

base64Attr := base64.StdEncoding.EncodeToString(nftUpdate.NewAttributes)
newTags := ExtractTagsFromAttributes(nftUpdate.NewAttributes)
truncatedAttributes := TruncateFieldIfExceedsMaxLengthBase64(string(nftUpdate.NewAttributes))
base64Attr := base64.StdEncoding.EncodeToString([]byte(truncatedAttributes))
newTags := TruncateSliceElementsIfExceedsMaxLength(ExtractTagsFromAttributes(nftUpdate.NewAttributes))
newMetadata := ExtractMetaDataFromAttributes(nftUpdate.NewAttributes)

marshalizedTags, errM := json.Marshal(newTags)
Expand Down Expand Up @@ -122,7 +123,11 @@ func PrepareNFTUpdateData(buffSlice *data.BufferSlice, updateNFTData []*data.NFT
FormatPainlessSource(codeToExecute), base64Attr, newMetadata, marshalizedTags),
)
if len(nftUpdate.URIsToAdd) != 0 {
marshalizedURIS, err := json.Marshal(nftUpdate.URIsToAdd)
uris := make([]string, 0, len(nftUpdate.URIsToAdd))
for _, uri := range nftUpdate.URIsToAdd {
uris = append(uris, base64.StdEncoding.EncodeToString(uri))
}
marshalizedURIS, err := json.Marshal(TruncateSliceElementsIfExceedsMaxLength(uris))
if err != nil {
return err
}
Expand Down
7 changes: 4 additions & 3 deletions process/elasticproc/elasticProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,12 @@ func (ei *elasticProcessor) RemoveAccountsESDT(headerTimestamp uint64, shardID u
}

// SaveMiniblocks will prepare and save information about miniblocks in elasticsearch server
func (ei *elasticProcessor) SaveMiniblocks(header coreData.HeaderHandler, body *block.Body) error {
func (ei *elasticProcessor) SaveMiniblocks(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) error {
if !ei.isIndexEnabled(elasticIndexer.MiniblocksIndex) {
return nil
}

mbs := ei.miniblocksProc.PrepareDBMiniblocks(header, body)
mbs := ei.miniblocksProc.PrepareDBMiniblocks(header, miniBlocks)
if len(mbs) == 0 {
return nil
}
Expand Down Expand Up @@ -424,7 +424,8 @@ func (ei *elasticProcessor) miniblocksInDBMap(mbs []*data.Miniblock, shardID uin
func (ei *elasticProcessor) SaveTransactions(obh *outport.OutportBlockWithHeader) error {
headerTimestamp := obh.Header.GetTimeStamp()

preparedResults := ei.transactionsProc.PrepareTransactionsForDatabase(obh.BlockData.Body, obh.Header, obh.TransactionPool, ei.isImportDB(), obh.NumberOfShards)
miniBlocks := append(obh.BlockData.Body.MiniBlocks, obh.BlockData.IntraShardMiniBlocks...)
preparedResults := ei.transactionsProc.PrepareTransactionsForDatabase(miniBlocks, obh.Header, obh.TransactionPool, ei.isImportDB(), obh.NumberOfShards)
logsData := ei.logsAndEventsProc.ExtractDataFromLogs(obh.TransactionPool.Logs, preparedResults, headerTimestamp, obh.Header.GetShardID(), obh.NumberOfShards)

buffers := data.NewBufferSlice(ei.bulkRequestMaxSize)
Expand Down
4 changes: 2 additions & 2 deletions process/elasticproc/elasticProcessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ func TestElasticProcessor_SaveMiniblocks(t *testing.T) {
body := &dataBlock.Body{MiniBlocks: dataBlock.MiniBlockSlice{
{SenderShardID: 0, ReceiverShardID: 1},
}}
err := elasticProc.SaveMiniblocks(header, body)
err := elasticProc.SaveMiniblocks(header, body.MiniBlocks)
require.Equal(t, localErr, err)
}

Expand Down Expand Up @@ -614,7 +614,7 @@ func TestElasticProcessor_SaveTransactionNoDataShouldNotDoRequest(t *testing.T)
called := false
arguments := createMockElasticProcessorArgs()
arguments.TransactionsProc = &mock.DBTransactionProcessorStub{
PrepareTransactionsForDatabaseCalled: func(body *dataBlock.Body, header coreData.HeaderHandler, pool *outport.TransactionPool) *data.PreparedResults {
PrepareTransactionsForDatabaseCalled: func(mbs []*dataBlock.MiniBlock, header coreData.HeaderHandler, pool *outport.TransactionPool) *data.PreparedResults {
return &data.PreparedResults{
Transactions: nil,
ScResults: nil,
Expand Down
4 changes: 2 additions & 2 deletions process/elasticproc/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type DBBlockHandler interface {
// DBTransactionsHandler defines the actions that a transactions handler should do
type DBTransactionsHandler interface {
PrepareTransactionsForDatabase(
body *block.Body,
miniBlocks []*block.MiniBlock,
header coreData.HeaderHandler,
pool *outport.TransactionPool,
isImportDB bool,
Expand All @@ -74,7 +74,7 @@ type DBTransactionsHandler interface {

// DBMiniblocksHandler defines the actions that a miniblocks handler should do
type DBMiniblocksHandler interface {
PrepareDBMiniblocks(header coreData.HeaderHandler, body *block.Body) []*data.Miniblock
PrepareDBMiniblocks(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) []*data.Miniblock
GetMiniblocksHashesHexEncoded(header coreData.HeaderHandler, body *block.Body) []string

SerializeBulkMiniBlocks(bulkMbs []*data.Miniblock, mbsInDB map[string]bool, buffSlice *data.BufferSlice, index string, shardID uint32)
Expand Down
16 changes: 8 additions & 8 deletions process/elasticproc/miniblocks/miniblocksProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ func NewMiniblocksProcessor(
}, nil
}

// PrepareDBMiniblocks will prepare miniblocks from body
func (mp *miniblocksProcessor) PrepareDBMiniblocks(header coreData.HeaderHandler, body *block.Body) []*data.Miniblock {
// PrepareDBMiniblocks will prepare miniblocks
func (mp *miniblocksProcessor) PrepareDBMiniblocks(header coreData.HeaderHandler, miniBlocks []*block.MiniBlock) []*data.Miniblock {
headerHash, err := mp.calculateHash(header)
if err != nil {
log.Warn("indexer: could not calculate header hash", "error", err)
return nil
}

dbMiniblocks := make([]*data.Miniblock, 0)
for mbIndex, miniblock := range body.MiniBlocks {
dbMiniblock, errPrepareMiniblock := mp.prepareMiniblockForDB(mbIndex, miniblock, header, headerHash)
if errPrepareMiniblock != nil {
log.Warn("miniblocksProcessor.PrepareDBMiniblocks cannot prepare miniblock", "error", errPrepareMiniblock)
for mbIndex, miniBlock := range miniBlocks {
dbMiniBlock, errPrepareMiniBlock := mp.prepareMiniblockForDB(mbIndex, miniBlock, header, headerHash)
if errPrepareMiniBlock != nil {
log.Warn("miniblocksProcessor.PrepareDBMiniBlocks cannot prepare miniblock", "error", errPrepareMiniBlock)
continue
}

dbMiniblocks = append(dbMiniblocks, dbMiniblock)
dbMiniblocks = append(dbMiniblocks, dbMiniBlock)
}

return dbMiniblocks
Expand Down Expand Up @@ -127,7 +127,7 @@ func (mp *miniblocksProcessor) setFieldsMBIntraShardAndCrossFromMe(
func (mp *miniblocksProcessor) computeProcessingTypeAndConstructionState(mbIndex int, header coreData.HeaderHandler) (string, int32) {
miniblockHeaders := header.GetMiniBlockHeaderHandlers()
if len(miniblockHeaders) <= mbIndex {
return "", 0
return block.Normal.String(), int32(block.Final)
}

processingType := miniblockHeaders[mbIndex].GetProcessingType()
Expand Down
40 changes: 27 additions & 13 deletions process/elasticproc/miniblocks/miniblocksProcessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
dataBlock "github.com/multiversx/mx-chain-core-go/data/block"
"github.com/multiversx/mx-chain-core-go/hashing"
"github.com/multiversx/mx-chain-core-go/marshal"
"github.com/multiversx/mx-chain-es-indexer-go/data"
"github.com/multiversx/mx-chain-es-indexer-go/mock"
"github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -64,7 +65,7 @@ func TestMiniblocksProcessor_PrepareDBMiniblocks(t *testing.T) {
},
}

miniblocks := mp.PrepareDBMiniblocks(header, body)
miniblocks := mp.PrepareDBMiniblocks(header, body.MiniBlocks)
require.Len(t, miniblocks, 3)
}

Expand All @@ -90,22 +91,35 @@ func TestMiniblocksProcessor_PrepareScheduledMB(t *testing.T) {
},
},
}
body := &dataBlock.Body{
MiniBlocks: []*dataBlock.MiniBlock{
{
SenderShardID: 0,
ReceiverShardID: 1,
},
{
SenderShardID: 0,
ReceiverShardID: 1,
},
miniBlocks := []*dataBlock.MiniBlock{
{
SenderShardID: 0,
ReceiverShardID: 1,
},
{
SenderShardID: 0,
ReceiverShardID: 1,
},
{
SenderShardID: 0,
ReceiverShardID: 0,
},
}

miniblocks := mp.PrepareDBMiniblocks(header, body)
require.Len(t, miniblocks, 2)
miniblocks := mp.PrepareDBMiniblocks(header, miniBlocks)
require.Len(t, miniblocks, 3)
require.Equal(t, dataBlock.Scheduled.String(), miniblocks[1].ProcessingTypeOnSource)

require.Equal(t, &data.Miniblock{
Hash: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
SenderShardID: 0,
ReceiverShardID: 0,
SenderBlockHash: "84b80cbf612d067201b5260b4c6f90fa7b5c11e898fa9c1c65f4c75e61e41619",
ReceiverBlockHash: "84b80cbf612d067201b5260b4c6f90fa7b5c11e898fa9c1c65f4c75e61e41619",
ProcessingTypeOnSource: dataBlock.Normal.String(),
ProcessingTypeOnDestination: dataBlock.Normal.String(),
Type: dataBlock.TxBlock.String(),
}, miniblocks[2])
}

func TestMiniblocksProcessor_GetMiniblocksHashesHexEncoded(t *testing.T) {
Expand Down
6 changes: 1 addition & 5 deletions process/elasticproc/transactions/checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/core/check"
coreData "github.com/multiversx/mx-chain-core-go/data"
"github.com/multiversx/mx-chain-core-go/data/block"
"github.com/multiversx/mx-chain-core-go/data/outport"
"github.com/multiversx/mx-chain-es-indexer-go/data"
elasticIndexer "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer"
Expand Down Expand Up @@ -51,13 +50,10 @@ func areESDTValuesOK(values []string) bool {
}

func checkPrepareTransactionForDatabaseArguments(
body *block.Body,
header coreData.HeaderHandler,
pool *outport.TransactionPool,
) error {
if body == nil {
return elasticIndexer.ErrNilBlockBody
}

if check.IfNil(header) {
return elasticIndexer.ErrNilHeaderHandler
}
Expand Down
Loading

0 comments on commit e0d4f5e

Please sign in to comment.