Skip to content

Commit

Permalink
Merge pull request #62 from ElrondNetwork/receipts-in-mb
Browse files Browse the repository at this point in the history
receipts in mb
  • Loading branch information
miiu96 authored Feb 9, 2022
2 parents 088e9a9 + 8183f2e commit ebfa738
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions data/api/apiBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type MiniBlock struct {
SourceShard uint32 `json:"sourceShard"`
DestinationShard uint32 `json:"destinationShard"`
Transactions []*transaction.ApiTransactionResult `json:"transactions,omitempty"`
Receipts []*transaction.ApiReceipt `json:"receipts,omitempty"`
}

// StakeValues is the structure that contains the total staked value and the total top up value
Expand Down
50 changes: 32 additions & 18 deletions data/transaction/apiTransactionResult.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,42 @@ type ApiTransactionResult struct {
SmartContractResults []*ApiSmartContractResult `json:"smartContractResults,omitempty"`
Logs *ApiLogs `json:"logs,omitempty"`
Status TxStatus `json:"status,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,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"`
}

// ApiSmartContractResult represents a smart contract result with changed fields' types in order to make it friendly for API's json
type ApiSmartContractResult struct {
Hash string `json:"hash,omitempty"`
Nonce uint64 `json:"nonce"`
Value *big.Int `json:"value"`
RcvAddr string `json:"receiver"`
SndAddr string `json:"sender"`
RelayerAddr string `json:"relayerAddress,omitempty"`
RelayedValue *big.Int `json:"relayedValue,omitempty"`
Code string `json:"code,omitempty"`
Data string `json:"data,omitempty"`
PrevTxHash string `json:"prevTxHash"`
OriginalTxHash string `json:"originalTxHash"`
GasLimit uint64 `json:"gasLimit"`
GasPrice uint64 `json:"gasPrice"`
CallType vm.CallType `json:"callType"`
CodeMetadata string `json:"codeMetadata,omitempty"`
ReturnMessage string `json:"returnMessage,omitempty"`
OriginalSender string `json:"originalSender,omitempty"`
Logs *ApiLogs `json:"logs,omitempty"`
Hash string `json:"hash,omitempty"`
Nonce uint64 `json:"nonce"`
Value *big.Int `json:"value"`
RcvAddr string `json:"receiver"`
SndAddr string `json:"sender"`
RelayerAddr string `json:"relayerAddress,omitempty"`
RelayedValue *big.Int `json:"relayedValue,omitempty"`
Code string `json:"code,omitempty"`
Data string `json:"data,omitempty"`
PrevTxHash string `json:"prevTxHash"`
OriginalTxHash string `json:"originalTxHash"`
GasLimit uint64 `json:"gasLimit"`
GasPrice uint64 `json:"gasPrice"`
CallType vm.CallType `json:"callType"`
CodeMetadata string `json:"codeMetadata,omitempty"`
ReturnMessage string `json:"returnMessage,omitempty"`
OriginalSender string `json:"originalSender,omitempty"`
Logs *ApiLogs `json:"logs,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,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"`
}

// ApiReceipt represents a receipt with changed fields' types in order to make it friendly for API's json
Expand Down

0 comments on commit ebfa738

Please sign in to comment.