diff --git a/data/transaction.go b/data/transaction.go index 89bf800e..6d1b784b 100644 --- a/data/transaction.go +++ b/data/transaction.go @@ -6,8 +6,8 @@ import ( // Transaction is a structure containing all the fields that need // -// to be saved for a transaction. It has all the default fields -// plus some extra information for ease of search and filter +// to be saved for a transaction. It has all the default fields +// plus some extra information for ease of search and filter type Transaction struct { MBHash string `json:"miniBlockHash"` Nonce uint64 `json:"nonce"` diff --git a/integrationtests/testdata/logsCrossShard/event-transfer-source-first.json b/integrationtests/testdata/logsCrossShard/event-transfer-source-first.json index 1551fcfb..d085f338 100644 --- a/integrationtests/testdata/logsCrossShard/event-transfer-source-first.json +++ b/integrationtests/testdata/logsCrossShard/event-transfer-source-first.json @@ -12,4 +12,4 @@ "txHash": "63726f73732d6c6f67", "order": 0, "timestamp": 5040 -} \ No newline at end of file +} diff --git a/process/elasticproc/logsevents/logsAndEventsProcessor.go b/process/elasticproc/logsevents/logsAndEventsProcessor.go index bdbc0499..ee4ab074 100644 --- a/process/elasticproc/logsevents/logsAndEventsProcessor.go +++ b/process/elasticproc/logsevents/logsAndEventsProcessor.go @@ -16,6 +16,8 @@ import ( "github.com/multiversx/mx-chain-es-indexer-go/process/dataindexer" ) +const eventIDFormat = "%s-%d-%d" + // ArgsLogsAndEventsProcessor holds all dependencies required to create new instances of logsAndEventsProcessor type ArgsLogsAndEventsProcessor struct { PubKeyConverter core.PubkeyConverter @@ -263,7 +265,7 @@ func (lep *logsAndEventsProcessor) prepareLogEvent(dbLog *data.Logs, event *data TxOrder: execOrder, OriginalTxHash: dbLog.OriginalTxHash, Timestamp: dbLog.Timestamp, - ID: fmt.Sprintf("%s-%d-%d", dbLog.ID, shardID, event.Order), + ID: fmt.Sprintf(eventIDFormat, dbLog.ID, shardID, event.Order), } return dbEvent