diff options
author | Felix Lange <fjl@twurst.com> | 2016-11-28 07:33:54 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-11-28 18:22:52 +0800 |
commit | 24f288770e90ab3fd6b30f9f16bf31396b6afeb7 (patch) | |
tree | e5fe6e6fe3400be252def9e6c785d4eb78d6f913 /core/types/receipt.go | |
parent | 65e6319b1295908dc049c3e796763ffe96cd6c25 (diff) | |
download | dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar.gz dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar.bz2 dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar.lz dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar.xz dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.tar.zst dexon-24f288770e90ab3fd6b30f9f16bf31396b6afeb7.zip |
core/types: use package hexutil for JSON handling
Diffstat (limited to 'core/types/receipt.go')
-rw-r--r-- | core/types/receipt.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/types/receipt.go b/core/types/receipt.go index b00fdabff..70c10d422 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -24,6 +24,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/rlp" ) @@ -49,12 +50,12 @@ type Receipt struct { type jsonReceipt struct { PostState *common.Hash `json:"root"` - CumulativeGasUsed *hexBig `json:"cumulativeGasUsed"` + CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed"` Bloom *Bloom `json:"logsBloom"` Logs *vm.Logs `json:"logs"` TxHash *common.Hash `json:"transactionHash"` ContractAddress *common.Address `json:"contractAddress"` - GasUsed *hexBig `json:"gasUsed"` + GasUsed *hexutil.Big `json:"gasUsed"` } // NewReceipt creates a barebone transaction receipt, copying the init fields. @@ -90,12 +91,12 @@ func (r *Receipt) MarshalJSON() ([]byte, error) { return json.Marshal(&jsonReceipt{ PostState: &root, - CumulativeGasUsed: (*hexBig)(r.CumulativeGasUsed), + CumulativeGasUsed: (*hexutil.Big)(r.CumulativeGasUsed), Bloom: &r.Bloom, Logs: &r.Logs, TxHash: &r.TxHash, ContractAddress: &r.ContractAddress, - GasUsed: (*hexBig)(r.GasUsed), + GasUsed: (*hexutil.Big)(r.GasUsed), }) } |