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/gen_receipt_json.go | |
parent | b8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff) | |
download | go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip |
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'core/types/gen_receipt_json.go')
-rw-r--r-- | core/types/gen_receipt_json.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index b95d99c95..520966874 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -5,7 +5,6 @@ package types import ( "encoding/json" "errors" - "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -15,22 +14,22 @@ func (r Receipt) MarshalJSON() ([]byte, error) { type Receipt struct { PostState hexutil.Bytes `json:"root"` Status hexutil.Uint `json:"status"` - CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed" gencodec:"required"` + CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"` Bloom Bloom `json:"logsBloom" gencodec:"required"` Logs []*Log `json:"logs" gencodec:"required"` TxHash common.Hash `json:"transactionHash" gencodec:"required"` ContractAddress common.Address `json:"contractAddress"` - GasUsed *hexutil.Big `json:"gasUsed" gencodec:"required"` + GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"` } var enc Receipt enc.PostState = r.PostState enc.Status = hexutil.Uint(r.Status) - enc.CumulativeGasUsed = (*hexutil.Big)(r.CumulativeGasUsed) + enc.CumulativeGasUsed = hexutil.Uint64(r.CumulativeGasUsed) enc.Bloom = r.Bloom enc.Logs = r.Logs enc.TxHash = r.TxHash enc.ContractAddress = r.ContractAddress - enc.GasUsed = (*hexutil.Big)(r.GasUsed) + enc.GasUsed = hexutil.Uint64(r.GasUsed) return json.Marshal(&enc) } @@ -38,12 +37,12 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { type Receipt struct { PostState hexutil.Bytes `json:"root"` Status *hexutil.Uint `json:"status"` - CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed" gencodec:"required"` + CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"` Bloom *Bloom `json:"logsBloom" gencodec:"required"` Logs []*Log `json:"logs" gencodec:"required"` TxHash *common.Hash `json:"transactionHash" gencodec:"required"` ContractAddress *common.Address `json:"contractAddress"` - GasUsed *hexutil.Big `json:"gasUsed" gencodec:"required"` + GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"` } var dec Receipt if err := json.Unmarshal(input, &dec); err != nil { @@ -58,7 +57,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { if dec.CumulativeGasUsed == nil { return errors.New("missing required field 'cumulativeGasUsed' for Receipt") } - r.CumulativeGasUsed = (*big.Int)(dec.CumulativeGasUsed) + r.CumulativeGasUsed = uint64(*dec.CumulativeGasUsed) if dec.Bloom == nil { return errors.New("missing required field 'logsBloom' for Receipt") } @@ -77,6 +76,6 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { if dec.GasUsed == nil { return errors.New("missing required field 'gasUsed' for Receipt") } - r.GasUsed = (*big.Int)(dec.GasUsed) + r.GasUsed = uint64(*dec.GasUsed) return nil } |