Skip to content

Commit

Permalink
Update addresses on receipts and TX info
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <[email protected]>
  • Loading branch information
nguyer committed Dec 18, 2023
1 parent 9648a93 commit c6e97d4
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pkg/ethereum/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ import (

// txReceiptJSONRPC is the receipt obtained over JSON/RPC from the ethereum client, with gas used, logs and contract address
type TXReceiptJSONRPC struct {
BlockHash ethtypes.HexBytes0xPrefix `json:"blockHash"`
BlockNumber *ethtypes.HexInteger `json:"blockNumber"`
ContractAddress *ethtypes.Address0xHex `json:"contractAddress"`
CumulativeGasUsed *ethtypes.HexInteger `json:"cumulativeGasUsed"`
From *ethtypes.AddressWithChecksum `json:"from"`
GasUsed *ethtypes.HexInteger `json:"gasUsed"`
Logs []*LogJSONRPC `json:"logs"`
Status *ethtypes.HexInteger `json:"status"`
To *ethtypes.AddressWithChecksum `json:"to"`
TransactionHash ethtypes.HexBytes0xPrefix `json:"transactionHash"`
TransactionIndex *ethtypes.HexInteger `json:"transactionIndex"`
BlockHash ethtypes.HexBytes0xPrefix `json:"blockHash"`
BlockNumber *ethtypes.HexInteger `json:"blockNumber"`
ContractAddress *ethtypes.Address0xHex `json:"contractAddress"`
CumulativeGasUsed *ethtypes.HexInteger `json:"cumulativeGasUsed"`
From *ethtypes.Address0xHex `json:"from"`
GasUsed *ethtypes.HexInteger `json:"gasUsed"`
Logs []*LogJSONRPC `json:"logs"`
Status *ethtypes.HexInteger `json:"status"`
To *ethtypes.Address0xHex `json:"to"`
TransactionHash ethtypes.HexBytes0xPrefix `json:"transactionHash"`
TransactionIndex *ethtypes.HexInteger `json:"transactionIndex"`
}

// receiptExtraInfo is the version of the receipt we store under the TX.
// - We omit the full logs from the JSON/RPC
// - We omit fields already in the standardized cross-blockchain section
// - We format numbers as decimals
type ReceiptExtraInfo struct {
ContractAddress *ethtypes.AddressWithChecksum `json:"contractAddress"`
CumulativeGasUsed *fftypes.FFBigInt `json:"cumulativeGasUsed"`
From *ethtypes.AddressWithChecksum `json:"from"`
To *ethtypes.AddressWithChecksum `json:"to"`
GasUsed *fftypes.FFBigInt `json:"gasUsed"`
Status *fftypes.FFBigInt `json:"status"`
ErrorMessage *string `json:"errorMessage"`
ContractAddress *ethtypes.Address0xHex `json:"contractAddress"`
CumulativeGasUsed *fftypes.FFBigInt `json:"cumulativeGasUsed"`
From *ethtypes.Address0xHex `json:"from"`
To *ethtypes.Address0xHex `json:"to"`
GasUsed *fftypes.FFBigInt `json:"gasUsed"`
Status *fftypes.FFBigInt `json:"status"`
ErrorMessage *string `json:"errorMessage"`
}

// txInfoJSONRPC is the transaction info obtained over JSON/RPC from the ethereum client, with input data
Expand Down

0 comments on commit c6e97d4

Please sign in to comment.