From 3d8de95f999de6f52f0c1605eb2913278f1d87d2 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 6 Apr 2017 10:38:21 +0200 Subject: core, core/types: regenerate JSON marshaling, add "hash" to headers (#13868) * Makefile: fix devtools target * core: regenerate genesis marshaling with fjl/gencodec@cbfa5be5a8a8 * core/types: regenerate marshaling methods with fjl/gencodec@cbfa5be5a8a8 * core/types: add "hash" to JSON headers --- core/genesis.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 34725241e..883cea2fd 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -41,16 +41,16 @@ var errGenesisNoConfig = errors.New("genesis has no chain configuration") // Genesis specifies the header fields, state of a genesis block. It also defines hard // fork switch-over blocks through the chain configuration. type Genesis struct { - Config *params.ChainConfig `json:"config" optional:"true"` - Nonce uint64 `json:"nonce" optional:"true"` - Timestamp uint64 `json:"timestamp" optional:"true"` - ParentHash common.Hash `json:"parentHash" optional:"true"` - ExtraData []byte `json:"extraData" optional:"true"` - GasLimit uint64 `json:"gasLimit"` - Difficulty *big.Int `json:"difficulty"` - Mixhash common.Hash `json:"mixHash" optional:"true"` - Coinbase common.Address `json:"coinbase" optional:"true"` - Alloc GenesisAlloc `json:"alloc"` + Config *params.ChainConfig `json:"config"` + Nonce uint64 `json:"nonce"` + Timestamp uint64 `json:"timestamp"` + ParentHash common.Hash `json:"parentHash"` + ExtraData []byte `json:"extraData"` + GasLimit uint64 `json:"gasLimit" gencodec:"required"` + Difficulty *big.Int `json:"difficulty" gencodec:"required"` + Mixhash common.Hash `json:"mixHash"` + Coinbase common.Address `json:"coinbase"` + Alloc GenesisAlloc `json:"alloc" gencodec:"required"` } // GenesisAlloc specifies the initial state that is part of the genesis block. @@ -58,10 +58,10 @@ type GenesisAlloc map[common.Address]GenesisAccount // GenesisAccount is an account in the state of the genesis block. type GenesisAccount struct { - Code []byte `json:"code,omitempty" optional:"true"` - Storage map[common.Hash]common.Hash `json:"storage,omitempty" optional:"true"` - Balance *big.Int `json:"balance"` - Nonce uint64 `json:"nonce,omitempty" optional:"true"` + Code []byte `json:"code,omitempty"` + Storage map[common.Hash]common.Hash `json:"storage,omitempty"` + Balance *big.Int `json:"balance" gencodec:"required"` + Nonce uint64 `json:"nonce,omitempty"` } // field type overrides for gencodec -- cgit v1.2.3