diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-11-13 19:47:27 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-03 20:45:35 +0800 |
commit | 6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (patch) | |
tree | c92974f8b82209073ad1ee3faec6e149f834bf69 /core/types/receipt.go | |
parent | b8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff) | |
download | go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.bz2 go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.lz go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.xz go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip |
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'core/types/receipt.go')
-rw-r--r-- | core/types/receipt.go | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/core/types/receipt.go b/core/types/receipt.go index bc3c996b4..208d54aaa 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -20,7 +20,6 @@ import ( "bytes" "fmt" "io" - "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -45,46 +44,46 @@ const ( // Receipt represents the results of a transaction. type Receipt struct { // Consensus fields - PostState []byte `json:"root"` - Status uint `json:"status"` - CumulativeGasUsed *big.Int `json:"cumulativeGasUsed" gencodec:"required"` - Bloom Bloom `json:"logsBloom" gencodec:"required"` - Logs []*Log `json:"logs" gencodec:"required"` + PostState []byte `json:"root"` + Status uint `json:"status"` + CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required"` + Bloom Bloom `json:"logsBloom" gencodec:"required"` + Logs []*Log `json:"logs" gencodec:"required"` // Implementation fields (don't reorder!) TxHash common.Hash `json:"transactionHash" gencodec:"required"` ContractAddress common.Address `json:"contractAddress"` - GasUsed *big.Int `json:"gasUsed" gencodec:"required"` + GasUsed uint64 `json:"gasUsed" gencodec:"required"` } type receiptMarshaling struct { PostState hexutil.Bytes Status hexutil.Uint - CumulativeGasUsed *hexutil.Big - GasUsed *hexutil.Big + CumulativeGasUsed hexutil.Uint64 + GasUsed hexutil.Uint64 } // receiptRLP is the consensus encoding of a receipt. type receiptRLP struct { PostStateOrStatus []byte - CumulativeGasUsed *big.Int + CumulativeGasUsed uint64 Bloom Bloom Logs []*Log } type receiptStorageRLP struct { PostStateOrStatus []byte - CumulativeGasUsed *big.Int + CumulativeGasUsed uint64 Bloom Bloom TxHash common.Hash ContractAddress common.Address Logs []*LogForStorage - GasUsed *big.Int + GasUsed uint64 } // NewReceipt creates a barebone transaction receipt, copying the init fields. -func NewReceipt(root []byte, failed bool, cumulativeGasUsed *big.Int) *Receipt { - r := &Receipt{PostState: common.CopyBytes(root), CumulativeGasUsed: new(big.Int).Set(cumulativeGasUsed)} +func NewReceipt(root []byte, failed bool, cumulativeGasUsed uint64) *Receipt { + r := &Receipt{PostState: common.CopyBytes(root), CumulativeGasUsed: cumulativeGasUsed} if failed { r.Status = ReceiptStatusFailed } else { |