Skip to content

Commit 1889119

Browse files
committed
fixes after review
1 parent 37f5294 commit 1889119

37 files changed

+312
-351
lines changed

data/account.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package data
22

33
import (
4-
"time"
5-
64
"github.com/multiversx/mx-chain-core-go/data/alteredAccount"
75
)
86

@@ -22,8 +20,8 @@ type AccountInfo struct {
2220
DeveloperRewards string `json:"developerRewards,omitempty"`
2321
DeveloperRewardsNum float64 `json:"developerRewardsNum,omitempty"`
2422
Data *TokenMetaData `json:"data,omitempty"`
25-
Timestamp time.Duration `json:"timestamp,omitempty"`
26-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
23+
Timestamp uint64 `json:"timestamp,omitempty"`
24+
TimestampMs uint64 `json:"timestampMs,omitempty"`
2725
Type string `json:"type,omitempty"`
2826
CurrentOwner string `json:"currentOwner,omitempty"`
2927
ShardID uint32 `json:"shardID"`
@@ -51,16 +49,16 @@ type TokenMetaData struct {
5149

5250
// AccountBalanceHistory represents an entry in the user accounts balances history
5351
type AccountBalanceHistory struct {
54-
Address string `json:"address"`
55-
Timestamp time.Duration `json:"timestamp"`
56-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
57-
Balance string `json:"balance"`
58-
Token string `json:"token,omitempty"`
59-
Identifier string `json:"identifier,omitempty"`
60-
TokenNonce uint64 `json:"tokenNonce,omitempty"`
61-
IsSender bool `json:"isSender,omitempty"`
62-
IsSmartContract bool `json:"isSmartContract,omitempty"`
63-
ShardID uint32 `json:"shardID"`
52+
Address string `json:"address"`
53+
Timestamp uint64 `json:"timestamp"`
54+
TimestampMs uint64 `json:"timestampMs,omitempty"`
55+
Balance string `json:"balance"`
56+
Token string `json:"token,omitempty"`
57+
Identifier string `json:"identifier,omitempty"`
58+
TokenNonce uint64 `json:"tokenNonce,omitempty"`
59+
IsSender bool `json:"isSender,omitempty"`
60+
IsSmartContract bool `json:"isSmartContract,omitempty"`
61+
ShardID uint32 `json:"shardID"`
6462
}
6563

6664
// Account is a structure that is needed for regular accounts

data/block.go

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package data
22

33
import (
4-
"time"
5-
64
"github.com/multiversx/mx-chain-core-go/data/api"
75
)
86

@@ -24,8 +22,8 @@ type Block struct {
2422
PubKeyBitmap string `json:"pubKeyBitmap"`
2523
Size int64 `json:"size"`
2624
SizeTxs int64 `json:"sizeTxs"`
27-
Timestamp time.Duration `json:"timestamp"`
28-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
25+
Timestamp uint64 `json:"timestamp"`
26+
TimestampMs uint64 `json:"timestampMs,omitempty"`
2927
StateRootHash string `json:"stateRootHash"`
3028
PrevHash string `json:"prevHash"`
3129
ShardID uint32 `json:"shardId"`
@@ -105,15 +103,15 @@ type EpochStartShardData struct {
105103

106104
// Miniblock is a structure containing miniblock information
107105
type Miniblock struct {
108-
Hash string `json:"hash,omitempty"`
109-
SenderShardID uint32 `json:"senderShard"`
110-
ReceiverShardID uint32 `json:"receiverShard"`
111-
SenderBlockHash string `json:"senderBlockHash,omitempty"`
112-
ReceiverBlockHash string `json:"receiverBlockHash,omitempty"`
113-
Type string `json:"type"`
114-
ProcessingTypeOnSource string `json:"procTypeS,omitempty"`
115-
ProcessingTypeOnDestination string `json:"procTypeD,omitempty"`
116-
Timestamp time.Duration `json:"timestamp"`
117-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
118-
Reserved []byte `json:"reserved,omitempty"`
106+
Hash string `json:"hash,omitempty"`
107+
SenderShardID uint32 `json:"senderShard"`
108+
ReceiverShardID uint32 `json:"receiverShard"`
109+
SenderBlockHash string `json:"senderBlockHash,omitempty"`
110+
ReceiverBlockHash string `json:"receiverBlockHash,omitempty"`
111+
Type string `json:"type"`
112+
ProcessingTypeOnSource string `json:"procTypeS,omitempty"`
113+
ProcessingTypeOnDestination string `json:"procTypeD,omitempty"`
114+
Timestamp uint64 `json:"timestamp"`
115+
TimestampMs uint64 `json:"timestampMs,omitempty"`
116+
Reserved []byte `json:"reserved,omitempty"`
119117
}

data/data.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package data
22

33
import (
44
"encoding/json"
5-
"time"
65
)
76

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

2524
// RoundInfo is a structure containing block signers and shard id
2625
type RoundInfo struct {
27-
Round uint64 `json:"round"`
28-
SignersIndexes []uint64 `json:"signersIndexes"`
29-
BlockWasProposed bool `json:"blockWasProposed"`
30-
ShardId uint32 `json:"shardId"`
31-
Epoch uint32 `json:"epoch"`
32-
Timestamp time.Duration `json:"timestamp"`
33-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
26+
Round uint64 `json:"round"`
27+
SignersIndexes []uint64 `json:"signersIndexes"`
28+
BlockWasProposed bool `json:"blockWasProposed"`
29+
ShardId uint32 `json:"shardId"`
30+
Epoch uint32 `json:"epoch"`
31+
Timestamp uint64 `json:"timestamp"`
32+
TimestampMs uint64 `json:"timestampMs,omitempty"`
3433
}
3534

3635
// EpochInfo holds the information about epoch

data/delegators.go

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
package data
22

3-
import "time"
4-
53
// Delegator is a structure that is needed to store information about a delegator
64
type Delegator struct {
7-
Address string `json:"address"`
8-
Contract string `json:"contract"`
9-
Timestamp time.Duration `json:"timestamp"`
10-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
11-
ActiveStake string `json:"activeStake"`
12-
ActiveStakeNum float64 `json:"activeStakeNum"`
13-
ShouldDelete bool `json:"-"`
14-
UnDelegateInfo *UnDelegate `json:"-"`
15-
WithdrawFundIDs []string `json:"-"`
5+
Address string `json:"address"`
6+
Contract string `json:"contract"`
7+
Timestamp uint64 `json:"timestamp"`
8+
TimestampMs uint64 `json:"timestampMs,omitempty"`
9+
ActiveStake string `json:"activeStake"`
10+
ActiveStakeNum float64 `json:"activeStakeNum"`
11+
ShouldDelete bool `json:"-"`
12+
UnDelegateInfo *UnDelegate `json:"-"`
13+
WithdrawFundIDs []string `json:"-"`
1614
}
1715

1816
// UnDelegate is a structure that is needed to store information about user unDelegate position
1917
type UnDelegate struct {
20-
Timestamp time.Duration `json:"timestamp"`
21-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
22-
ID string `json:"id"`
23-
Value string `json:"value"`
24-
ValueNum float64 `json:"valueNum"`
18+
Timestamp uint64 `json:"timestamp"`
19+
TimestampMs uint64 `json:"timestampMs,omitempty"`
20+
ID string `json:"id"`
21+
Value string `json:"value"`
22+
ValueNum float64 `json:"valueNum"`
2523
}

data/event.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
package data
22

3-
import "time"
4-
53
// LogEvent is the dto for the log event structure
64
type LogEvent struct {
7-
UUID string `json:"uuid"`
8-
ID string `json:"-"`
9-
TxHash string `json:"txHash"`
10-
OriginalTxHash string `json:"originalTxHash,omitempty"`
11-
LogAddress string `json:"logAddress"`
12-
Address string `json:"address"`
13-
Identifier string `json:"identifier"`
14-
Data string `json:"data,omitempty"`
15-
AdditionalData []string `json:"additionalData,omitempty"`
16-
Topics []string `json:"topics"`
17-
Order int `json:"order"`
18-
TxOrder int `json:"txOrder"`
19-
ShardID uint32 `json:"shardID"`
20-
Timestamp time.Duration `json:"timestamp,omitempty"`
21-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
5+
UUID string `json:"uuid"`
6+
ID string `json:"-"`
7+
TxHash string `json:"txHash"`
8+
OriginalTxHash string `json:"originalTxHash,omitempty"`
9+
LogAddress string `json:"logAddress"`
10+
Address string `json:"address"`
11+
Identifier string `json:"identifier"`
12+
Data string `json:"data,omitempty"`
13+
AdditionalData []string `json:"additionalData,omitempty"`
14+
Topics []string `json:"topics"`
15+
Order int `json:"order"`
16+
TxOrder int `json:"txOrder"`
17+
ShardID uint32 `json:"shardID"`
18+
Timestamp uint64 `json:"timestamp,omitempty"`
19+
TimestampMs uint64 `json:"timestampMs,omitempty"`
2220
}

data/logs.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
package data
22

33
import (
4-
"time"
5-
64
"github.com/multiversx/mx-chain-core-go/data/outport"
75
"github.com/multiversx/mx-chain-es-indexer-go/process/elasticproc/tokeninfo"
86
)
97

108
// Logs holds all the fields needed for a logs structure
119
type Logs struct {
12-
UUID string `json:"uuid"`
13-
ID string `json:"-"`
14-
OriginalTxHash string `json:"originalTxHash,omitempty"`
15-
Address string `json:"address"`
16-
Events []*Event `json:"events"`
17-
Timestamp time.Duration `json:"timestamp,omitempty"`
18-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
10+
UUID string `json:"uuid"`
11+
ID string `json:"-"`
12+
OriginalTxHash string `json:"originalTxHash,omitempty"`
13+
Address string `json:"address"`
14+
Events []*Event `json:"events"`
15+
Timestamp uint64 `json:"timestamp,omitempty"`
16+
TimestampMs uint64 `json:"timestampMs,omitempty"`
1917
}
2018

2119
// Event holds all the fields needed for an event structure

data/scresult.go

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
11
package data
22

3-
import "time"
4-
53
// ScResult is a structure containing all the fields that need to be saved for a smart contract result
64
type ScResult struct {
7-
UUID string `json:"uuid"`
8-
Hash string `json:"-"`
9-
MBHash string `json:"miniBlockHash,omitempty"`
10-
Nonce uint64 `json:"nonce"`
11-
GasLimit uint64 `json:"gasLimit"`
12-
GasPrice uint64 `json:"gasPrice"`
13-
Value string `json:"value"`
14-
ValueNum float64 `json:"valueNum"`
15-
Sender string `json:"sender"`
16-
Receiver string `json:"receiver"`
17-
SenderShard uint32 `json:"senderShard"`
18-
ReceiverShard uint32 `json:"receiverShard"`
19-
RelayerAddr string `json:"relayerAddr,omitempty"`
20-
RelayedValue string `json:"relayedValue,omitempty"`
21-
Code string `json:"code,omitempty"`
22-
Data []byte `json:"data,omitempty"`
23-
PrevTxHash string `json:"prevTxHash"`
24-
OriginalTxHash string `json:"originalTxHash"`
25-
CallType string `json:"callType"`
26-
CodeMetadata []byte `json:"codeMetaData,omitempty"`
27-
ReturnMessage string `json:"returnMessage,omitempty"`
28-
Timestamp time.Duration `json:"timestamp"`
29-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
30-
HasOperations bool `json:"hasOperations,omitempty"`
31-
Type string `json:"type,omitempty"`
32-
Status string `json:"status,omitempty"`
33-
Tokens []string `json:"tokens,omitempty"`
34-
ESDTValues []string `json:"esdtValues,omitempty"`
35-
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
36-
Receivers []string `json:"receivers,omitempty"`
37-
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
38-
Operation string `json:"operation,omitempty"`
39-
Function string `json:"function,omitempty"`
40-
IsRelayed bool `json:"isRelayed,omitempty"`
41-
CanBeIgnored bool `json:"canBeIgnored,omitempty"`
42-
OriginalSender string `json:"originalSender,omitempty"`
43-
HasLogs bool `json:"hasLogs,omitempty"`
44-
Epoch uint32 `json:"epoch"`
45-
ExecutionOrder int `json:"-"`
46-
SenderAddressBytes []byte `json:"-"`
47-
InitialTxGasUsed uint64 `json:"-"`
48-
InitialTxFee string `json:"-"`
49-
GasRefunded uint64 `json:"-"`
5+
UUID string `json:"uuid"`
6+
Hash string `json:"-"`
7+
MBHash string `json:"miniBlockHash,omitempty"`
8+
Nonce uint64 `json:"nonce"`
9+
GasLimit uint64 `json:"gasLimit"`
10+
GasPrice uint64 `json:"gasPrice"`
11+
Value string `json:"value"`
12+
ValueNum float64 `json:"valueNum"`
13+
Sender string `json:"sender"`
14+
Receiver string `json:"receiver"`
15+
SenderShard uint32 `json:"senderShard"`
16+
ReceiverShard uint32 `json:"receiverShard"`
17+
RelayerAddr string `json:"relayerAddr,omitempty"`
18+
RelayedValue string `json:"relayedValue,omitempty"`
19+
Code string `json:"code,omitempty"`
20+
Data []byte `json:"data,omitempty"`
21+
PrevTxHash string `json:"prevTxHash"`
22+
OriginalTxHash string `json:"originalTxHash"`
23+
CallType string `json:"callType"`
24+
CodeMetadata []byte `json:"codeMetaData,omitempty"`
25+
ReturnMessage string `json:"returnMessage,omitempty"`
26+
Timestamp uint64 `json:"timestamp"`
27+
TimestampMs uint64 `json:"timestampMs,omitempty"`
28+
HasOperations bool `json:"hasOperations,omitempty"`
29+
Type string `json:"type,omitempty"`
30+
Status string `json:"status,omitempty"`
31+
Tokens []string `json:"tokens,omitempty"`
32+
ESDTValues []string `json:"esdtValues,omitempty"`
33+
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
34+
Receivers []string `json:"receivers,omitempty"`
35+
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
36+
Operation string `json:"operation,omitempty"`
37+
Function string `json:"function,omitempty"`
38+
IsRelayed bool `json:"isRelayed,omitempty"`
39+
CanBeIgnored bool `json:"canBeIgnored,omitempty"`
40+
OriginalSender string `json:"originalSender,omitempty"`
41+
HasLogs bool `json:"hasLogs,omitempty"`
42+
Epoch uint32 `json:"epoch"`
43+
ExecutionOrder int `json:"-"`
44+
SenderAddressBytes []byte `json:"-"`
45+
InitialTxGasUsed uint64 `json:"-"`
46+
InitialTxFee string `json:"-"`
47+
GasRefunded uint64 `json:"-"`
5048
}

data/tokens.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package data
22

33
import (
4-
"time"
5-
64
"github.com/multiversx/mx-chain-core-go/core"
75
)
86

@@ -56,8 +54,8 @@ type TokenInfo struct {
5654
NumDecimals uint64 `json:"numDecimals"`
5755
Type string `json:"type,omitempty"`
5856
Nonce uint64 `json:"nonce,omitempty"`
59-
Timestamp time.Duration `json:"timestamp,omitempty"`
60-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
57+
Timestamp uint64 `json:"timestamp,omitempty"`
58+
TimestampMs uint64 `json:"timestampMs,omitempty"`
6159
Data *TokenMetaData `json:"data,omitempty"`
6260
OwnersHistory []*OwnerData `json:"ownersHistory,omitempty"`
6361
TransferOwnership bool `json:"-"`
@@ -81,10 +79,10 @@ type TokenProperties struct {
8179

8280
// OwnerData is a structure that is needed to store information about an owner
8381
type OwnerData struct {
84-
TxHash string `json:"txHash,omitempty"`
85-
Address string `json:"address"`
86-
Timestamp time.Duration `json:"timestamp"`
87-
TimestampMs time.Duration `json:"timestampMs,omitempty"`
82+
TxHash string `json:"txHash,omitempty"`
83+
Address string `json:"address"`
84+
Timestamp uint64 `json:"timestamp"`
85+
TimestampMs uint64 `json:"timestampMs,omitempty"`
8886
}
8987

9088
// TokensHandler defines the actions that a tokens' handler should do

0 commit comments

Comments
 (0)