aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-03-27 17:52:39 +0800
committerFelix Lange <fjl@twurst.com>2017-03-27 19:29:01 +0800
commitaa9a78e4639e8594849be3fa0f92d7f91f67d528 (patch)
treed1e84875024142fb9535c27cf6aa168c042f279a /core/types
parent7419d0c38291236ecc4e54b1a905d5cbcbe065a4 (diff)
downloaddexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar.gz
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar.bz2
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar.lz
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar.xz
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.tar.zst
dexon-aa9a78e4639e8594849be3fa0f92d7f91f67d528.zip
core, core/types: use non-pointer receiver for Marshal* methods
Regenerated with fjl/gencodec@1a75a2161009 Also add ,omitempty to optional GenesisAccount fields.
Diffstat (limited to 'core/types')
-rw-r--r--core/types/gen_header_json.go52
-rw-r--r--core/types/gen_log_json.go36
-rw-r--r--core/types/gen_receipt_json.go24
-rw-r--r--core/types/gen_tx_json.go8
4 files changed, 60 insertions, 60 deletions
diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go
index 860622e6e..91663d9d8 100644
--- a/core/types/gen_header_json.go
+++ b/core/types/gen_header_json.go
@@ -1,4 +1,4 @@
-// generated by github.com/fjl/gencodec, do not edit.
+// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package types
@@ -11,40 +11,40 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-func (h *Header) MarshalJSON() ([]byte, error) {
+func (h Header) MarshalJSON() ([]byte, error) {
type HeaderJSON struct {
- ParentHash *common.Hash `json:"parentHash"`
- UncleHash *common.Hash `json:"sha3Uncles"`
- Coinbase *common.Address `json:"miner"`
- Root *common.Hash `json:"stateRoot"`
- TxHash *common.Hash `json:"transactionsRoot"`
- ReceiptHash *common.Hash `json:"receiptsRoot"`
- Bloom *Bloom `json:"logsBloom"`
- Difficulty *hexutil.Big `json:"difficulty"`
- Number *hexutil.Big `json:"number"`
- GasLimit *hexutil.Big `json:"gasLimit"`
- GasUsed *hexutil.Big `json:"gasUsed"`
- Time *hexutil.Big `json:"timestamp"`
- Extra hexutil.Bytes `json:"extraData"`
- MixDigest *common.Hash `json:"mixHash"`
- Nonce *BlockNonce `json:"nonce"`
+ ParentHash common.Hash `json:"parentHash"`
+ UncleHash common.Hash `json:"sha3Uncles"`
+ Coinbase common.Address `json:"miner"`
+ Root common.Hash `json:"stateRoot"`
+ TxHash common.Hash `json:"transactionsRoot"`
+ ReceiptHash common.Hash `json:"receiptsRoot"`
+ Bloom Bloom `json:"logsBloom"`
+ Difficulty *hexutil.Big `json:"difficulty"`
+ Number *hexutil.Big `json:"number"`
+ GasLimit *hexutil.Big `json:"gasLimit"`
+ GasUsed *hexutil.Big `json:"gasUsed"`
+ Time *hexutil.Big `json:"timestamp"`
+ Extra hexutil.Bytes `json:"extraData"`
+ MixDigest common.Hash `json:"mixHash"`
+ Nonce BlockNonce `json:"nonce"`
}
var enc HeaderJSON
- enc.ParentHash = &h.ParentHash
- enc.UncleHash = &h.UncleHash
- enc.Coinbase = &h.Coinbase
- enc.Root = &h.Root
- enc.TxHash = &h.TxHash
- enc.ReceiptHash = &h.ReceiptHash
- enc.Bloom = &h.Bloom
+ enc.ParentHash = h.ParentHash
+ enc.UncleHash = h.UncleHash
+ enc.Coinbase = h.Coinbase
+ enc.Root = h.Root
+ enc.TxHash = h.TxHash
+ enc.ReceiptHash = h.ReceiptHash
+ enc.Bloom = h.Bloom
enc.Difficulty = (*hexutil.Big)(h.Difficulty)
enc.Number = (*hexutil.Big)(h.Number)
enc.GasLimit = (*hexutil.Big)(h.GasLimit)
enc.GasUsed = (*hexutil.Big)(h.GasUsed)
enc.Time = (*hexutil.Big)(h.Time)
enc.Extra = h.Extra
- enc.MixDigest = &h.MixDigest
- enc.Nonce = &h.Nonce
+ enc.MixDigest = h.MixDigest
+ enc.Nonce = h.Nonce
return json.Marshal(&enc)
}
diff --git a/core/types/gen_log_json.go b/core/types/gen_log_json.go
index ef2cdfd89..5c8032953 100644
--- a/core/types/gen_log_json.go
+++ b/core/types/gen_log_json.go
@@ -1,4 +1,4 @@
-// generated by github.com/fjl/gencodec, do not edit.
+// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package types
@@ -10,28 +10,28 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-func (l *Log) MarshalJSON() ([]byte, error) {
+func (l Log) MarshalJSON() ([]byte, error) {
type LogJSON struct {
- Address *common.Address `json:"address"`
- Topics []common.Hash `json:"topics"`
- Data hexutil.Bytes `json:"data"`
- BlockNumber *hexutil.Uint64 `json:"blockNumber" optional:"yes"`
- TxHash *common.Hash `json:"transactionHash"`
- TxIndex *hexutil.Uint `json:"transactionIndex"`
- BlockHash *common.Hash `json:"blockHash" optional:"yes"`
- Index *hexutil.Uint `json:"logIndex"`
- Removed *bool `json:"removed" optional:"yes"`
+ Address common.Address `json:"address"`
+ Topics []common.Hash `json:"topics"`
+ Data hexutil.Bytes `json:"data"`
+ BlockNumber hexutil.Uint64 `json:"blockNumber" optional:"yes"`
+ TxHash common.Hash `json:"transactionHash"`
+ TxIndex hexutil.Uint `json:"transactionIndex"`
+ BlockHash common.Hash `json:"blockHash" optional:"yes"`
+ Index hexutil.Uint `json:"logIndex"`
+ Removed bool `json:"removed" optional:"yes"`
}
var enc LogJSON
- enc.Address = &l.Address
+ enc.Address = l.Address
enc.Topics = l.Topics
enc.Data = l.Data
- enc.BlockNumber = (*hexutil.Uint64)(&l.BlockNumber)
- enc.TxHash = &l.TxHash
- enc.TxIndex = (*hexutil.Uint)(&l.TxIndex)
- enc.BlockHash = &l.BlockHash
- enc.Index = (*hexutil.Uint)(&l.Index)
- enc.Removed = &l.Removed
+ enc.BlockNumber = hexutil.Uint64(l.BlockNumber)
+ enc.TxHash = l.TxHash
+ enc.TxIndex = hexutil.Uint(l.TxIndex)
+ enc.BlockHash = l.BlockHash
+ enc.Index = hexutil.Uint(l.Index)
+ enc.Removed = l.Removed
return json.Marshal(&enc)
}
diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go
index b9e9bee26..6583a8ec0 100644
--- a/core/types/gen_receipt_json.go
+++ b/core/types/gen_receipt_json.go
@@ -1,4 +1,4 @@
-// generated by github.com/fjl/gencodec, do not edit.
+// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package types
@@ -11,23 +11,23 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-func (r *Receipt) MarshalJSON() ([]byte, error) {
+func (r Receipt) MarshalJSON() ([]byte, error) {
type ReceiptJSON struct {
- PostState hexutil.Bytes `json:"root"`
- CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed"`
- Bloom *Bloom `json:"logsBloom"`
- Logs []*Log `json:"logs"`
- TxHash *common.Hash `json:"transactionHash"`
- ContractAddress *common.Address `json:"contractAddress" optional:"true"`
- GasUsed *hexutil.Big `json:"gasUsed"`
+ PostState hexutil.Bytes `json:"root"`
+ CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed"`
+ Bloom Bloom `json:"logsBloom"`
+ Logs []*Log `json:"logs"`
+ TxHash common.Hash `json:"transactionHash"`
+ ContractAddress common.Address `json:"contractAddress" optional:"true"`
+ GasUsed *hexutil.Big `json:"gasUsed"`
}
var enc ReceiptJSON
enc.PostState = r.PostState
enc.CumulativeGasUsed = (*hexutil.Big)(r.CumulativeGasUsed)
- enc.Bloom = &r.Bloom
+ enc.Bloom = r.Bloom
enc.Logs = r.Logs
- enc.TxHash = &r.TxHash
- enc.ContractAddress = &r.ContractAddress
+ enc.TxHash = r.TxHash
+ enc.ContractAddress = r.ContractAddress
enc.GasUsed = (*hexutil.Big)(r.GasUsed)
return json.Marshal(&enc)
}
diff --git a/core/types/gen_tx_json.go b/core/types/gen_tx_json.go
index 8bbe629d7..0adcc59b5 100644
--- a/core/types/gen_tx_json.go
+++ b/core/types/gen_tx_json.go
@@ -1,4 +1,4 @@
-// generated by github.com/fjl/gencodec, do not edit.
+// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package types
@@ -11,9 +11,9 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-func (t *txdata) MarshalJSON() ([]byte, error) {
+func (t txdata) MarshalJSON() ([]byte, error) {
type txdataJSON struct {
- AccountNonce *hexutil.Uint64 `json:"nonce"`
+ AccountNonce hexutil.Uint64 `json:"nonce"`
Price *hexutil.Big `json:"gasPrice"`
GasLimit *hexutil.Big `json:"gasLimit"`
Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"`
@@ -25,7 +25,7 @@ func (t *txdata) MarshalJSON() ([]byte, error) {
Hash *common.Hash `json:"hash" optional:"yes" rlp:"-"`
}
var enc txdataJSON
- enc.AccountNonce = (*hexutil.Uint64)(&t.AccountNonce)
+ enc.AccountNonce = hexutil.Uint64(t.AccountNonce)
enc.Price = (*hexutil.Big)(t.Price)
enc.GasLimit = (*hexutil.Big)(t.GasLimit)
enc.Recipient = t.Recipient