Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions data/account.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/data/alteredAccount"
)

Expand All @@ -22,7 +20,8 @@ type AccountInfo struct {
DeveloperRewards string `json:"developerRewards,omitempty"`
DeveloperRewardsNum float64 `json:"developerRewardsNum,omitempty"`
Data *TokenMetaData `json:"data,omitempty"`
Timestamp time.Duration `json:"timestamp,omitempty"`
Timestamp uint64 `json:"timestamp,omitempty"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Type string `json:"type,omitempty"`
CurrentOwner string `json:"currentOwner,omitempty"`
ShardID uint32 `json:"shardID"`
Expand Down Expand Up @@ -50,15 +49,16 @@ type TokenMetaData struct {

// AccountBalanceHistory represents an entry in the user accounts balances history
type AccountBalanceHistory struct {
Address string `json:"address"`
Timestamp time.Duration `json:"timestamp"`
Balance string `json:"balance"`
Token string `json:"token,omitempty"`
Identifier string `json:"identifier,omitempty"`
TokenNonce uint64 `json:"tokenNonce,omitempty"`
IsSender bool `json:"isSender,omitempty"`
IsSmartContract bool `json:"isSmartContract,omitempty"`
ShardID uint32 `json:"shardID"`
Address string `json:"address"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Balance string `json:"balance"`
Token string `json:"token,omitempty"`
Identifier string `json:"identifier,omitempty"`
TokenNonce uint64 `json:"tokenNonce,omitempty"`
IsSender bool `json:"isSender,omitempty"`
IsSmartContract bool `json:"isSmartContract,omitempty"`
ShardID uint32 `json:"shardID"`
}

// Account is a structure that is needed for regular accounts
Expand Down
26 changes: 13 additions & 13 deletions data/block.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/data/api"
)

Expand All @@ -24,7 +22,8 @@ type Block struct {
PubKeyBitmap string `json:"pubKeyBitmap"`
Size int64 `json:"size"`
SizeTxs int64 `json:"sizeTxs"`
Timestamp time.Duration `json:"timestamp"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
StateRootHash string `json:"stateRootHash"`
PrevHash string `json:"prevHash"`
ShardID uint32 `json:"shardId"`
Expand Down Expand Up @@ -104,14 +103,15 @@ type EpochStartShardData struct {

// Miniblock is a structure containing miniblock information
type Miniblock struct {
Hash string `json:"hash,omitempty"`
SenderShardID uint32 `json:"senderShard"`
ReceiverShardID uint32 `json:"receiverShard"`
SenderBlockHash string `json:"senderBlockHash,omitempty"`
ReceiverBlockHash string `json:"receiverBlockHash,omitempty"`
Type string `json:"type"`
ProcessingTypeOnSource string `json:"procTypeS,omitempty"`
ProcessingTypeOnDestination string `json:"procTypeD,omitempty"`
Timestamp time.Duration `json:"timestamp"`
Reserved []byte `json:"reserved,omitempty"`
Hash string `json:"hash,omitempty"`
SenderShardID uint32 `json:"senderShard"`
ReceiverShardID uint32 `json:"receiverShard"`
SenderBlockHash string `json:"senderBlockHash,omitempty"`
ReceiverBlockHash string `json:"receiverBlockHash,omitempty"`
Type string `json:"type"`
ProcessingTypeOnSource string `json:"procTypeS,omitempty"`
ProcessingTypeOnDestination string `json:"procTypeD,omitempty"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Reserved []byte `json:"reserved,omitempty"`
}
14 changes: 7 additions & 7 deletions data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package data

import (
"encoding/json"
"time"
)

// ValidatorsPublicKeys is a structure containing fields for validators public keys
Expand All @@ -24,12 +23,13 @@ type ValidatorRatingInfo struct {

// RoundInfo is a structure containing block signers and shard id
type RoundInfo struct {
Round uint64 `json:"round"`
SignersIndexes []uint64 `json:"signersIndexes"`
BlockWasProposed bool `json:"blockWasProposed"`
ShardId uint32 `json:"shardId"`
Epoch uint32 `json:"epoch"`
Timestamp time.Duration `json:"timestamp"`
Round uint64 `json:"round"`
SignersIndexes []uint64 `json:"signersIndexes"`
BlockWasProposed bool `json:"blockWasProposed"`
ShardId uint32 `json:"shardId"`
Epoch uint32 `json:"epoch"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
}

// EpochInfo holds the information about epoch
Expand Down
28 changes: 14 additions & 14 deletions data/delegators.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package data

import "time"

// Delegator is a structure that is needed to store information about a delegator
type Delegator struct {
Address string `json:"address"`
Contract string `json:"contract"`
Timestamp time.Duration `json:"timestamp"`
ActiveStake string `json:"activeStake"`
ActiveStakeNum float64 `json:"activeStakeNum"`
ShouldDelete bool `json:"-"`
UnDelegateInfo *UnDelegate `json:"-"`
WithdrawFundIDs []string `json:"-"`
Address string `json:"address"`
Contract string `json:"contract"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
ActiveStake string `json:"activeStake"`
ActiveStakeNum float64 `json:"activeStakeNum"`
ShouldDelete bool `json:"-"`
UnDelegateInfo *UnDelegate `json:"-"`
WithdrawFundIDs []string `json:"-"`
}

// UnDelegate is a structure that is needed to store information about user unDelegate position
type UnDelegate struct {
Timestamp time.Duration `json:"timestamp"`
ID string `json:"id"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
ID string `json:"id"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
}
31 changes: 15 additions & 16 deletions data/event.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package data

import "time"

// LogEvent is the dto for the log event structure
type LogEvent struct {
UUID string `json:"uuid"`
ID string `json:"-"`
TxHash string `json:"txHash"`
OriginalTxHash string `json:"originalTxHash,omitempty"`
LogAddress string `json:"logAddress"`
Address string `json:"address"`
Identifier string `json:"identifier"`
Data string `json:"data,omitempty"`
AdditionalData []string `json:"additionalData,omitempty"`
Topics []string `json:"topics"`
Order int `json:"order"`
TxOrder int `json:"txOrder"`
ShardID uint32 `json:"shardID"`
Timestamp time.Duration `json:"timestamp,omitempty"`
UUID string `json:"uuid"`
ID string `json:"-"`
TxHash string `json:"txHash"`
OriginalTxHash string `json:"originalTxHash,omitempty"`
LogAddress string `json:"logAddress"`
Address string `json:"address"`
Identifier string `json:"identifier"`
Data string `json:"data,omitempty"`
AdditionalData []string `json:"additionalData,omitempty"`
Topics []string `json:"topics"`
Order int `json:"order"`
TxOrder int `json:"txOrder"`
ShardID uint32 `json:"shardID"`
Timestamp uint64 `json:"timestamp,omitempty"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
}
15 changes: 7 additions & 8 deletions data/logs.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/data/outport"
"github.com/multiversx/mx-chain-es-indexer-go/process/elasticproc/tokeninfo"
)

// Logs holds all the fields needed for a logs structure
type Logs struct {
UUID string `json:"uuid"`
ID string `json:"-"`
OriginalTxHash string `json:"originalTxHash,omitempty"`
Address string `json:"address"`
Events []*Event `json:"events"`
Timestamp time.Duration `json:"timestamp,omitempty"`
UUID string `json:"uuid"`
ID string `json:"-"`
OriginalTxHash string `json:"originalTxHash,omitempty"`
Address string `json:"address"`
Events []*Event `json:"events"`
Timestamp uint64 `json:"timestamp,omitempty"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
}

// Event holds all the fields needed for an event structure
Expand Down
10 changes: 6 additions & 4 deletions data/scDeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ type ScDeployInfo struct {
CurrentOwner string `json:"currentOwner"`
CodeHash []byte `json:"initialCodeHash"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Upgrades []*Upgrade `json:"upgrades"`
OwnersHistory []*OwnerData `json:"owners"`
}

// Upgrade is the DTO that holds information about a smart contract upgrade
type Upgrade struct {
TxHash string `json:"upgradeTxHash"`
Upgrader string `json:"upgrader"`
Timestamp uint64 `json:"timestamp"`
CodeHash []byte `json:"codeHash"`
TxHash string `json:"upgradeTxHash"`
Upgrader string `json:"upgrader"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs"`
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The TimestampMs field in Upgrade lacks the omitempty JSON tag, which causes zero values to always be serialized. Consider adding omitempty for consistency with other timestamp fields.

Suggested change
TimestampMs uint64 `json:"timestampMs"`
TimestampMs uint64 `json:"timestampMs,omitempty"`

Copilot uses AI. Check for mistakes.
CodeHash []byte `json:"codeHash"`
}
87 changes: 43 additions & 44 deletions data/scresult.go
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
package data

import "time"

// ScResult is a structure containing all the fields that need to be saved for a smart contract result
type ScResult struct {
UUID string `json:"uuid"`
Hash string `json:"-"`
MBHash string `json:"miniBlockHash,omitempty"`
Nonce uint64 `json:"nonce"`
GasLimit uint64 `json:"gasLimit"`
GasPrice uint64 `json:"gasPrice"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
Sender string `json:"sender"`
Receiver string `json:"receiver"`
SenderShard uint32 `json:"senderShard"`
ReceiverShard uint32 `json:"receiverShard"`
RelayerAddr string `json:"relayerAddr,omitempty"`
RelayedValue string `json:"relayedValue,omitempty"`
Code string `json:"code,omitempty"`
Data []byte `json:"data,omitempty"`
PrevTxHash string `json:"prevTxHash"`
OriginalTxHash string `json:"originalTxHash"`
CallType string `json:"callType"`
CodeMetadata []byte `json:"codeMetaData,omitempty"`
ReturnMessage string `json:"returnMessage,omitempty"`
Timestamp time.Duration `json:"timestamp"`
HasOperations bool `json:"hasOperations,omitempty"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,omitempty"`
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
Receivers []string `json:"receivers,omitempty"`
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
Operation string `json:"operation,omitempty"`
Function string `json:"function,omitempty"`
IsRelayed bool `json:"isRelayed,omitempty"`
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:"-"`
InitialTxFee string `json:"-"`
GasRefunded uint64 `json:"-"`
UUID string `json:"uuid"`
Hash string `json:"-"`
MBHash string `json:"miniBlockHash,omitempty"`
Nonce uint64 `json:"nonce"`
GasLimit uint64 `json:"gasLimit"`
GasPrice uint64 `json:"gasPrice"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
Sender string `json:"sender"`
Receiver string `json:"receiver"`
SenderShard uint32 `json:"senderShard"`
ReceiverShard uint32 `json:"receiverShard"`
RelayerAddr string `json:"relayerAddr,omitempty"`
RelayedValue string `json:"relayedValue,omitempty"`
Code string `json:"code,omitempty"`
Data []byte `json:"data,omitempty"`
PrevTxHash string `json:"prevTxHash"`
OriginalTxHash string `json:"originalTxHash"`
CallType string `json:"callType"`
CodeMetadata []byte `json:"codeMetaData,omitempty"`
ReturnMessage string `json:"returnMessage,omitempty"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
HasOperations bool `json:"hasOperations,omitempty"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,omitempty"`
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
Receivers []string `json:"receivers,omitempty"`
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
Operation string `json:"operation,omitempty"`
Function string `json:"function,omitempty"`
IsRelayed bool `json:"isRelayed,omitempty"`
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:"-"`
InitialTxFee string `json:"-"`
GasRefunded uint64 `json:"-"`
}
12 changes: 6 additions & 6 deletions data/tokens.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/core"
)

Expand Down Expand Up @@ -56,7 +54,8 @@ type TokenInfo struct {
NumDecimals uint64 `json:"numDecimals"`
Type string `json:"type,omitempty"`
Nonce uint64 `json:"nonce,omitempty"`
Timestamp time.Duration `json:"timestamp,omitempty"`
Timestamp uint64 `json:"timestamp,omitempty"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Data *TokenMetaData `json:"data,omitempty"`
OwnersHistory []*OwnerData `json:"ownersHistory,omitempty"`
TransferOwnership bool `json:"-"`
Expand All @@ -80,9 +79,10 @@ type TokenProperties struct {

// OwnerData is a structure that is needed to store information about an owner
type OwnerData struct {
TxHash string `json:"txHash,omitempty"`
Address string `json:"address"`
Timestamp time.Duration `json:"timestamp"`
TxHash string `json:"txHash,omitempty"`
Address string `json:"address"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
}

// TokensHandler defines the actions that a tokens' handler should do
Expand Down
Loading
Loading