diff options
author | gary rong <garyrong0905@gmail.com> | 2018-05-23 16:10:24 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-05-23 16:10:24 +0800 |
commit | fbf57d53e272c2d79d4d899bb94db824678de2d5 (patch) | |
tree | 3b0bd337c9b2919e85205a3e10a61b54aaf28abb /core/types/gen_receipt_json.go | |
parent | 6ce21a4744461fc35c05b1c5fcc92136761be747 (diff) | |
download | go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar.gz go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar.bz2 go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar.lz go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar.xz go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.tar.zst go-tangerine-fbf57d53e272c2d79d4d899bb94db824678de2d5.zip |
core/types: convert status type from uint to uint64 (#16784)
Diffstat (limited to 'core/types/gen_receipt_json.go')
-rw-r--r-- | core/types/gen_receipt_json.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index c297adebb..5c807a4cc 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -12,10 +12,11 @@ import ( var _ = (*receiptMarshaling)(nil) +// MarshalJSON marshals as JSON. func (r Receipt) MarshalJSON() ([]byte, error) { type Receipt struct { PostState hexutil.Bytes `json:"root"` - Status hexutil.Uint `json:"status"` + Status hexutil.Uint64 `json:"status"` CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"` Bloom Bloom `json:"logsBloom" gencodec:"required"` Logs []*Log `json:"logs" gencodec:"required"` @@ -25,7 +26,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) { } var enc Receipt enc.PostState = r.PostState - enc.Status = hexutil.Uint(r.Status) + enc.Status = hexutil.Uint64(r.Status) enc.CumulativeGasUsed = hexutil.Uint64(r.CumulativeGasUsed) enc.Bloom = r.Bloom enc.Logs = r.Logs @@ -35,10 +36,11 @@ func (r Receipt) MarshalJSON() ([]byte, error) { return json.Marshal(&enc) } +// UnmarshalJSON unmarshals from JSON. func (r *Receipt) UnmarshalJSON(input []byte) error { type Receipt struct { PostState *hexutil.Bytes `json:"root"` - Status *hexutil.Uint `json:"status"` + Status *hexutil.Uint64 `json:"status"` CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"` Bloom *Bloom `json:"logsBloom" gencodec:"required"` Logs []*Log `json:"logs" gencodec:"required"` @@ -54,7 +56,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { r.PostState = *dec.PostState } if dec.Status != nil { - r.Status = uint(*dec.Status) + r.Status = uint64(*dec.Status) } if dec.CumulativeGasUsed == nil { return errors.New("missing required field 'cumulativeGasUsed' for Receipt") |