aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-04-06 16:38:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-04-06 16:38:21 +0800
commit3d8de95f999de6f52f0c1605eb2913278f1d87d2 (patch)
tree1906f5ec11dbbd304bb30f3e75c117727a4d1e79 /core/genesis.go
parent24b9860c1bc214d2db943bc69117818311406bdb (diff)
downloaddexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar.gz
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar.bz2
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar.lz
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar.xz
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.tar.zst
dexon-3d8de95f999de6f52f0c1605eb2913278f1d87d2.zip
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
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go28
1 files changed, 14 insertions, 14 deletions
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