diff options
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 } |