diff --git a/data/scresult.go b/data/scresult.go index 0df0d020..7ff11fbf 100644 --- a/data/scresult.go +++ b/data/scresult.go @@ -40,6 +40,7 @@ type ScResult struct { CanBeIgnored bool `json:"canBeIgnored,omitempty"` OriginalSender string `json:"originalSender,omitempty"` HasLogs bool `json:"hasLogs,omitempty"` + Epoch uint32 `json:"epoch"` ExecutionOrder int `json:"-"` SenderAddressBytes []byte `json:"-"` InitialTxGasUsed uint64 `json:"-"` diff --git a/data/transaction.go b/data/transaction.go index 384b4b58..4e1800ec 100644 --- a/data/transaction.go +++ b/data/transaction.go @@ -52,6 +52,7 @@ type Transaction struct { RelayedAddr string `json:"relayer,omitempty"` RelayedSignature string `json:"relayerSignature,omitempty"` HadRefund bool `json:"hadRefund,omitempty"` + Epoch uint32 `json:"epoch"` ExecutionOrder int `json:"-"` SmartContractResults []*ScResult `json:"-"` Hash string `json:"-"` diff --git a/integrationtests/testdata/claimRewards/tx-claim-rewards.json b/integrationtests/testdata/claimRewards/tx-claim-rewards.json index c11ef56c..044a0c5f 100644 --- a/integrationtests/testdata/claimRewards/tx-claim-rewards.json +++ b/integrationtests/testdata/claimRewards/tx-claim-rewards.json @@ -24,5 +24,6 @@ "operation": "transfer", "function": "claimRewards", "isScCall": true, - "hasLogs": true + "hasLogs": true, + "epoch": 0 } diff --git a/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-destination.json b/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-destination.json index 2e1bc23b..81cd1701 100644 --- a/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-destination.json +++ b/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-destination.json @@ -30,5 +30,6 @@ 1e-17 ], "type": "normal", - "operation": "ESDTTransfer" + "operation": "ESDTTransfer", + "epoch": 0 } diff --git a/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-source.json b/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-source.json index df53964e..187e5d7b 100644 --- a/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-source.json +++ b/integrationtests/testdata/esdtTransfer/esdt-transfer-cross-shard-on-source.json @@ -30,5 +30,6 @@ 1e-17 ], "type": "normal", - "operation": "ESDTTransfer" + "operation": "ESDTTransfer", + "epoch": 0 } diff --git a/integrationtests/testdata/esdtTransfer/esdt-transfer-first-on-destination.json b/integrationtests/testdata/esdtTransfer/esdt-transfer-first-on-destination.json index 1b0f46b7..73b1a310 100644 --- a/integrationtests/testdata/esdtTransfer/esdt-transfer-first-on-destination.json +++ b/integrationtests/testdata/esdtTransfer/esdt-transfer-first-on-destination.json @@ -30,5 +30,6 @@ "receiverShard": 1, "operation": "ESDTTransfer", "status": "success", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/esdtTransfer/esdt-transfer-second-on-source.json b/integrationtests/testdata/esdtTransfer/esdt-transfer-second-on-source.json index eccaa6ba..2bbb9222 100644 --- a/integrationtests/testdata/esdtTransfer/esdt-transfer-second-on-source.json +++ b/integrationtests/testdata/esdtTransfer/esdt-transfer-second-on-source.json @@ -30,5 +30,6 @@ "receiverShard": 1, "operation": "ESDTTransfer", "status": "success", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/esdtTransfer/esdt-transfer.json b/integrationtests/testdata/esdtTransfer/esdt-transfer.json index 871e60a6..9f68664e 100644 --- a/integrationtests/testdata/esdtTransfer/esdt-transfer.json +++ b/integrationtests/testdata/esdtTransfer/esdt-transfer.json @@ -29,5 +29,6 @@ "esdtValuesNum": [ 1e-17 ], - "operation": "ESDTTransfer" + "operation": "ESDTTransfer", + "epoch": 0 } diff --git a/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-after-execution-of-scr-dst-shard.json b/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-after-execution-of-scr-dst-shard.json index 032af67c..4a3a96b6 100644 --- a/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-after-execution-of-scr-dst-shard.json +++ b/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-after-execution-of-scr-dst-shard.json @@ -42,5 +42,6 @@ "operation": "MultiESDTNFTTransfer", "status": "fail", "searchOrder": 0, - "errorEvent": true + "errorEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-executed-on-source.json b/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-executed-on-source.json index a86b0649..f5d08816 100644 --- a/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-executed-on-source.json +++ b/integrationtests/testdata/multiTransferWithScCallAndErrorSignaledBySC/transaction-executed-on-source.json @@ -41,5 +41,6 @@ "receiverShard": 0, "operation": "MultiESDTNFTTransfer", "status": "success", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/op-nft-transfer-sc-call-after-refund.json b/integrationtests/testdata/nftTransferCrossShard/op-nft-transfer-sc-call-after-refund.json index 32c4ff66..66973883 100644 --- a/integrationtests/testdata/nftTransferCrossShard/op-nft-transfer-sc-call-after-refund.json +++ b/integrationtests/testdata/nftTransferCrossShard/op-nft-transfer-sc-call-after-refund.json @@ -37,5 +37,6 @@ ], "operation": "ESDTNFTTransfer", "type": "normal", - "function": "compoundRewardsProxy" + "function": "compoundRewardsProxy", + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-complete-with-status.json b/integrationtests/testdata/nftTransferCrossShard/tx-complete-with-status.json index 62168879..34e1fa1d 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-complete-with-status.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-complete-with-status.json @@ -36,5 +36,6 @@ "status": "fail", "initialPaidFee": "595490000000000", "searchOrder": 0, - "errorEvent": true + "errorEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-failed-on-dst.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-failed-on-dst.json index 70f07153..42c7bff5 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-failed-on-dst.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-failed-on-dst.json @@ -36,5 +36,6 @@ 2 ], "operation": "ESDTNFTTransfer", - "errorEvent": true + "errorEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-after-refund.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-after-refund.json index 1223f2e7..8adf0bcf 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-after-refund.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-after-refund.json @@ -36,5 +36,6 @@ 1 ], "operation": "ESDTNFTTransfer", - "function": "compoundRewardsProxy" + "function": "compoundRewardsProxy", + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-source.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-source.json index 0342ec98..ac53e099 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-source.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-sc-call-source.json @@ -36,5 +36,6 @@ "timestamp": 5040, "status": "success", "initialPaidFee": "1904415000000000", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-destination-first.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-destination-first.json index 5781ea71..39a992f9 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-destination-first.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-destination-first.json @@ -18,5 +18,6 @@ "timestamp": 0, "status": "", "searchOrder": 0, - "completedEvent": true + "completedEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-source-second.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-source-second.json index f30d8dee..412fd37f 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-source-second.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer-success-source-second.json @@ -36,5 +36,6 @@ "receiverShard": 0, "operation": "ESDTNFTTransfer", "status": "success", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer.json b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer.json index dc2e7dc7..b2951f89 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-nft-transfer.json @@ -35,5 +35,6 @@ "gasPrice": 1000000000, "timestamp": 5040, "status": "success", - "searchOrder": 0 + "searchOrder": 0, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShard/tx-with-status-only.json b/integrationtests/testdata/nftTransferCrossShard/tx-with-status-only.json index c9a4c62a..f0f59b97 100644 --- a/integrationtests/testdata/nftTransferCrossShard/tx-with-status-only.json +++ b/integrationtests/testdata/nftTransferCrossShard/tx-with-status-only.json @@ -18,5 +18,6 @@ "timestamp": 0, "status": "fail", "searchOrder": 0, - "errorEvent": true + "errorEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/nftTransferCrossShardWithScCall/cross-shard-transfer-with-sc-call.json b/integrationtests/testdata/nftTransferCrossShardWithScCall/cross-shard-transfer-with-sc-call.json index 07f16691..3891231f 100644 --- a/integrationtests/testdata/nftTransferCrossShardWithScCall/cross-shard-transfer-with-sc-call.json +++ b/integrationtests/testdata/nftTransferCrossShardWithScCall/cross-shard-transfer-with-sc-call.json @@ -36,5 +36,6 @@ 2 ], "operation": "ESDTNFTTransfer", - "function": "claimRewards" + "function": "claimRewards", + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTx/relayed-tx-after-refund.json b/integrationtests/testdata/relayedTx/relayed-tx-after-refund.json index dd85dc43..9551d92a 100644 --- a/integrationtests/testdata/relayedTx/relayed-tx-after-refund.json +++ b/integrationtests/testdata/relayedTx/relayed-tx-after-refund.json @@ -28,5 +28,6 @@ ], "operation": "transfer", "function": "saveAttestation", - "isRelayed": true + "isRelayed": true, + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTx/relayed-tx-intra.json b/integrationtests/testdata/relayedTx/relayed-tx-intra.json index cf066e85..dca3547e 100644 --- a/integrationtests/testdata/relayedTx/relayed-tx-intra.json +++ b/integrationtests/testdata/relayedTx/relayed-tx-intra.json @@ -27,5 +27,6 @@ 1 ], "operation": "SaveKeyValue", - "isRelayed": true + "isRelayed": true, + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTx/relayed-tx-source.json b/integrationtests/testdata/relayedTx/relayed-tx-source.json index 9c907820..4e6d217a 100644 --- a/integrationtests/testdata/relayedTx/relayed-tx-source.json +++ b/integrationtests/testdata/relayedTx/relayed-tx-source.json @@ -28,5 +28,6 @@ ], "operation": "transfer", "function": "saveAttestation", - "isRelayed": true + "isRelayed": true, + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTxV3/relayed-v3-no-refund.json b/integrationtests/testdata/relayedTxV3/relayed-v3-no-refund.json index e4c03f30..aabff5b8 100644 --- a/integrationtests/testdata/relayedTxV3/relayed-v3-no-refund.json +++ b/integrationtests/testdata/relayedTxV3/relayed-v3-no-refund.json @@ -24,5 +24,6 @@ "function": "doSomething", "isRelayed": true, "relayer": "erd10ksryjr065ad5475jcg82pnjfg9j9qtszjsrp24anl6ym7cmeddshwnru8", - "relayerSignature": "61" + "relayerSignature": "61", + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTxV3/relayed-v3-with-one-refund.json b/integrationtests/testdata/relayedTxV3/relayed-v3-with-one-refund.json index d8aee273..d0c40bba 100644 --- a/integrationtests/testdata/relayedTxV3/relayed-v3-with-one-refund.json +++ b/integrationtests/testdata/relayedTxV3/relayed-v3-with-one-refund.json @@ -25,5 +25,6 @@ "isRelayed": true, "relayer": "erd10ksryjr065ad5475jcg82pnjfg9j9qtszjsrp24anl6ym7cmeddshwnru8", "relayerSignature": "61", - "hadRefund": true + "hadRefund": true, + "epoch": 0 } diff --git a/integrationtests/testdata/relayedTxV3/relayed-v3-with-two-refunds.json b/integrationtests/testdata/relayedTxV3/relayed-v3-with-two-refunds.json index b060be66..62e10c15 100644 --- a/integrationtests/testdata/relayedTxV3/relayed-v3-with-two-refunds.json +++ b/integrationtests/testdata/relayedTxV3/relayed-v3-with-two-refunds.json @@ -25,5 +25,6 @@ "isRelayed": true, "relayer": "erd10ksryjr065ad5475jcg82pnjfg9j9qtszjsrp24anl6ym7cmeddshwnru8", "relayerSignature": "61", - "hadRefund": true + "hadRefund": true, + "epoch": 0 } diff --git a/integrationtests/testdata/scCallIntraShard/claim-rewards.json b/integrationtests/testdata/scCallIntraShard/claim-rewards.json index 6de4372a..7e8d77ca 100644 --- a/integrationtests/testdata/scCallIntraShard/claim-rewards.json +++ b/integrationtests/testdata/scCallIntraShard/claim-rewards.json @@ -22,5 +22,6 @@ "hasScResults": true, "operation": "transfer", "isScCall": true, - "function": "claimRewards" + "function": "claimRewards", + "epoch": 0 } diff --git a/integrationtests/testdata/scCallIntraShard/sc-call-fail.json b/integrationtests/testdata/scCallIntraShard/sc-call-fail.json index aaea4caf..22dac8d7 100644 --- a/integrationtests/testdata/scCallIntraShard/sc-call-fail.json +++ b/integrationtests/testdata/scCallIntraShard/sc-call-fail.json @@ -25,5 +25,6 @@ "function": "delegate", "errorEvent": true, "hasLogs": true, - "hasOperations": true + "hasOperations": true, + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-destination-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-destination-shard.json index d0896ee1..5b145d2c 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-destination-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-destination-shard.json @@ -18,5 +18,6 @@ "type": "unsigned", "status": "success", "operation": "transfer", - "hasLogs": true + "hasLogs": true, + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-source.json b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-source.json index 5bc7cbb2..d409e116 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-source.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-callback-executed-on-source.json @@ -16,5 +16,6 @@ "timestamp": 5040, "type": "unsigned", "status": "pending", - "operation": "transfer" + "operation": "transfer", + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-destination-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-destination-shard.json index 448dfb9e..cccd0b56 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-destination-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-destination-shard.json @@ -17,5 +17,6 @@ "type": "unsigned", "status": "success", "operation": "transfer", - "function": "issueNonFungible" + "function": "issueNonFungible", + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-source-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-source-shard.json index 3703f353..7339cb15 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-source-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/scr-with-issue-executed-on-source-shard.json @@ -17,5 +17,6 @@ "type": "unsigned", "status": "pending", "operation": "transfer", - "function": "issueNonFungible" + "function": "issueNonFungible", + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-of-callback-on-destination-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-of-callback-on-destination-shard.json index ce08d35c..ed524a11 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-of-callback-on-destination-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-of-callback-on-destination-shard.json @@ -23,5 +23,6 @@ "isScCall": true, "operation": "transfer", "function": "issueToken", - "errorEvent": true + "errorEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-on-source-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-on-source-shard.json index 6ea6fd40..cb9c4326 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-on-source-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/tx-after-execution-on-source-shard.json @@ -22,6 +22,7 @@ "hasScResults": true, "isScCall": true, "operation": "transfer", - "function": "issueToken" + "function": "issueToken", + "epoch": 0 } diff --git a/integrationtests/testdata/scCallWithIssueEsdt/tx-in-op-index-execution-of-callback-on-destination-shard.json b/integrationtests/testdata/scCallWithIssueEsdt/tx-in-op-index-execution-of-callback-on-destination-shard.json index 305833e8..f13509ee 100644 --- a/integrationtests/testdata/scCallWithIssueEsdt/tx-in-op-index-execution-of-callback-on-destination-shard.json +++ b/integrationtests/testdata/scCallWithIssueEsdt/tx-in-op-index-execution-of-callback-on-destination-shard.json @@ -24,5 +24,6 @@ "operation": "transfer", "function": "issueToken", "errorEvent": true, - "type": "normal" + "type": "normal", + "epoch": 0 } diff --git a/integrationtests/testdata/scDeploy/tx-deploy-with-error-event.json b/integrationtests/testdata/scDeploy/tx-deploy-with-error-event.json index 1229065c..1bd1c109 100644 --- a/integrationtests/testdata/scDeploy/tx-deploy-with-error-event.json +++ b/integrationtests/testdata/scDeploy/tx-deploy-with-error-event.json @@ -25,5 +25,6 @@ "type": "normal", "operation": "scDeploy", "errorEvent": true, - "completedEvent": true + "completedEvent": true, + "epoch": 0 } diff --git a/integrationtests/testdata/scDeploy/tx-sc-deploy.json b/integrationtests/testdata/scDeploy/tx-sc-deploy.json index 03a79f1b..ad7da041 100644 --- a/integrationtests/testdata/scDeploy/tx-sc-deploy.json +++ b/integrationtests/testdata/scDeploy/tx-sc-deploy.json @@ -20,5 +20,6 @@ "status": "success", "searchOrder": 0, "isScCall": true, - "operation": "scDeploy" + "operation": "scDeploy", + "epoch": 0 } diff --git a/integrationtests/testdata/transactions/move-balance.json b/integrationtests/testdata/transactions/move-balance.json index 266cfe1c..b5b56f0f 100644 --- a/integrationtests/testdata/transactions/move-balance.json +++ b/integrationtests/testdata/transactions/move-balance.json @@ -19,5 +19,6 @@ "timestamp": 5040, "status": "success", "searchOrder": 0, - "operation": "transfer" + "operation": "transfer", + "epoch": 0 } diff --git a/process/elasticproc/operations/serialize_test.go b/process/elasticproc/operations/serialize_test.go index b877c04d..2b098dc0 100644 --- a/process/elasticproc/operations/serialize_test.go +++ b/process/elasticproc/operations/serialize_test.go @@ -27,8 +27,8 @@ func TestOperationsProcessor_SerializeSCRS(t *testing.T) { err := op.SerializeSCRs(scrs, buffSlice, "operations", 0) require.Nil(t, err) require.Equal(t, `{"update":{"_index":"operations","_id":""}} -{"script":{"source":"return"},"upsert":{"uuid":"","nonce":0,"gasLimit":0,"gasPrice":0,"value":"","valueNum":0,"sender":"","receiver":"","senderShard":0,"receiverShard":1,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0}} +{"script":{"source":"return"},"upsert":{"uuid":"","nonce":0,"gasLimit":0,"gasPrice":0,"value":"","valueNum":0,"sender":"","receiver":"","senderShard":0,"receiverShard":1,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0,"epoch":0}} { "index" : { "_index":"operations","_id" : "" } } -{"uuid":"","nonce":0,"gasLimit":0,"gasPrice":0,"value":"","valueNum":0,"sender":"","receiver":"","senderShard":2,"receiverShard":0,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0} +{"uuid":"","nonce":0,"gasLimit":0,"gasPrice":0,"value":"","valueNum":0,"sender":"","receiver":"","senderShard":2,"receiverShard":0,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0,"epoch":0} `, buffSlice.Buffers()[0].String()) } diff --git a/process/elasticproc/transactions/serialize_test.go b/process/elasticproc/transactions/serialize_test.go index d8fb52f4..d9ad8513 100644 --- a/process/elasticproc/transactions/serialize_test.go +++ b/process/elasticproc/transactions/serialize_test.go @@ -39,9 +39,9 @@ func TestSerializeScResults(t *testing.T) { require.Equal(t, 1, len(buffSlice.Buffers())) expectedRes := `{ "index" : { "_index": "transactions", "_id" : "hash1" } } -{"uuid":"","nonce":1,"gasLimit":50,"gasPrice":10,"value":"100","valueNum":1e-16,"sender":"","receiver":"","senderShard":0,"receiverShard":1,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0} +{"uuid":"","nonce":1,"gasLimit":50,"gasPrice":10,"value":"100","valueNum":1e-16,"sender":"","receiver":"","senderShard":0,"receiverShard":1,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0,"epoch":0} { "index" : { "_index": "transactions", "_id" : "hash2" } } -{"uuid":"","nonce":2,"gasLimit":50,"gasPrice":10,"value":"20","valueNum":2e-17,"sender":"","receiver":"","senderShard":2,"receiverShard":3,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0} +{"uuid":"","nonce":2,"gasLimit":50,"gasPrice":10,"value":"20","valueNum":2e-17,"sender":"","receiver":"","senderShard":2,"receiverShard":3,"prevTxHash":"","originalTxHash":"","callType":"","timestamp":0,"epoch":0} ` require.Equal(t, expectedRes, buffSlice.Buffers()[0].String()) } @@ -86,7 +86,7 @@ func TestSerializeTransactionsIntraShardTx(t *testing.T) { require.Nil(t, err) expectedBuff := `{ "index" : { "_index":"transactions", "_id" : "txHash" } } -{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":0,"senderShard":0,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0} +{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":0,"senderShard":0,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0,"epoch":0} ` require.Equal(t, expectedBuff, buffSlice.Buffers()[0].String()) } @@ -105,7 +105,7 @@ func TestSerializeTransactionCrossShardTxSource(t *testing.T) { require.Nil(t, err) expectedBuff := `{"update":{ "_index":"transactions", "_id":"txHash"}} -{"script":{"source":"return"},"upsert":{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":1,"senderShard":0,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0,"version":1}} +{"script":{"source":"return"},"upsert":{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":1,"senderShard":0,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0,"version":1,"epoch":0}} ` require.Equal(t, expectedBuff, buffSlice.Buffers()[0].String()) } @@ -124,7 +124,7 @@ func TestSerializeTransactionsCrossShardTxDestination(t *testing.T) { require.Nil(t, err) expectedBuff := `{ "index" : { "_index":"transactions", "_id" : "txHash" } } -{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":0,"senderShard":1,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0,"version":1} +{"uuid":"","miniBlockHash":"","nonce":0,"round":0,"value":"","valueNum":0,"receiver":"","sender":"","receiverShard":0,"senderShard":1,"gasPrice":0,"gasLimit":0,"gasUsed":0,"fee":"","feeNum":0,"data":null,"signature":"","timestamp":0,"status":"","searchOrder":0,"version":1,"epoch":0} ` require.Equal(t, expectedBuff, buffSlice.Buffers()[0].String()) } diff --git a/process/elasticproc/transactions/smartContractResultsProcessor.go b/process/elasticproc/transactions/smartContractResultsProcessor.go index 1fe62ace..495978cd 100644 --- a/process/elasticproc/transactions/smartContractResultsProcessor.go +++ b/process/elasticproc/transactions/smartContractResultsProcessor.go @@ -192,6 +192,7 @@ func (proc *smartContractResultsProcessor) prepareSmartContractResult( GasRefunded: feeInfo.GasRefunded, ExecutionOrder: int(scrInfo.ExecutionOrder), UUID: converters.GenerateBase64UUID(), + Epoch: header.GetEpoch(), } } diff --git a/process/elasticproc/transactions/transactionDBBuilder.go b/process/elasticproc/transactions/transactionDBBuilder.go index cf605f49..3bb75015 100644 --- a/process/elasticproc/transactions/transactionDBBuilder.go +++ b/process/elasticproc/transactions/transactionDBBuilder.go @@ -127,6 +127,7 @@ func (dtb *dbTransactionBuilder) prepareTransaction( RelayedAddr: relayedAddress, HadRefund: feeInfo.HadRefund, UUID: converters.GenerateBase64UUID(), + Epoch: header.GetEpoch(), } hasValidRelayer := len(eTx.RelayedAddr) == len(eTx.Sender) && len(eTx.RelayedAddr) > 0 @@ -178,6 +179,7 @@ func (dtb *dbTransactionBuilder) prepareRewardTransaction( Operation: rewardsOperation, ExecutionOrder: int(rTxInfo.ExecutionOrder), UUID: converters.GenerateBase64UUID(), + Epoch: header.GetEpoch(), } }