|
|
@ -1,4 +1,4 @@ |
|
|
|
// generated by github.com/fjl/gencodec, do not edit.
|
|
|
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
|
|
package core |
|
|
|
package core |
|
|
|
|
|
|
|
|
|
|
@ -13,31 +13,29 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/params" |
|
|
|
"github.com/ethereum/go-ethereum/params" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func (g *Genesis) MarshalJSON() ([]byte, error) { |
|
|
|
func (g Genesis) MarshalJSON() ([]byte, error) { |
|
|
|
type GenesisJSON struct { |
|
|
|
type GenesisJSON struct { |
|
|
|
ChainConfig *params.ChainConfig `json:"config" optional:"true"` |
|
|
|
Config *params.ChainConfig `json:"config" optional:"true"` |
|
|
|
Nonce *math.HexOrDecimal64 `json:"nonce" optional:"true"` |
|
|
|
Nonce math.HexOrDecimal64 `json:"nonce" optional:"true"` |
|
|
|
Timestamp *math.HexOrDecimal64 `json:"timestamp" optional:"true"` |
|
|
|
Timestamp math.HexOrDecimal64 `json:"timestamp" optional:"true"` |
|
|
|
ParentHash *common.Hash `json:"parentHash" optional:"true"` |
|
|
|
ParentHash common.Hash `json:"parentHash" optional:"true"` |
|
|
|
ExtraData hexutil.Bytes `json:"extraData" optional:"true"` |
|
|
|
ExtraData hexutil.Bytes `json:"extraData" optional:"true"` |
|
|
|
GasLimit *math.HexOrDecimal64 `json:"gasLimit"` |
|
|
|
GasLimit math.HexOrDecimal64 `json:"gasLimit"` |
|
|
|
Difficulty *math.HexOrDecimal256 `json:"difficulty"` |
|
|
|
Difficulty *math.HexOrDecimal256 `json:"difficulty"` |
|
|
|
Mixhash *common.Hash `json:"mixHash" optional:"true"` |
|
|
|
Mixhash common.Hash `json:"mixHash" optional:"true"` |
|
|
|
Coinbase *common.Address `json:"coinbase" optional:"true"` |
|
|
|
Coinbase common.Address `json:"coinbase" optional:"true"` |
|
|
|
Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"` |
|
|
|
Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"` |
|
|
|
} |
|
|
|
} |
|
|
|
var enc GenesisJSON |
|
|
|
var enc GenesisJSON |
|
|
|
enc.ChainConfig = g.Config |
|
|
|
enc.Config = g.Config |
|
|
|
enc.Nonce = (*math.HexOrDecimal64)(&g.Nonce) |
|
|
|
enc.Nonce = math.HexOrDecimal64(g.Nonce) |
|
|
|
enc.Timestamp = (*math.HexOrDecimal64)(&g.Timestamp) |
|
|
|
enc.Timestamp = math.HexOrDecimal64(g.Timestamp) |
|
|
|
enc.ParentHash = &g.ParentHash |
|
|
|
enc.ParentHash = g.ParentHash |
|
|
|
if g.ExtraData != nil { |
|
|
|
enc.ExtraData = g.ExtraData |
|
|
|
enc.ExtraData = g.ExtraData |
|
|
|
enc.GasLimit = math.HexOrDecimal64(g.GasLimit) |
|
|
|
} |
|
|
|
|
|
|
|
enc.GasLimit = (*math.HexOrDecimal64)(&g.GasLimit) |
|
|
|
|
|
|
|
enc.Difficulty = (*math.HexOrDecimal256)(g.Difficulty) |
|
|
|
enc.Difficulty = (*math.HexOrDecimal256)(g.Difficulty) |
|
|
|
enc.Mixhash = &g.Mixhash |
|
|
|
enc.Mixhash = g.Mixhash |
|
|
|
enc.Coinbase = &g.Coinbase |
|
|
|
enc.Coinbase = g.Coinbase |
|
|
|
if g.Alloc != nil { |
|
|
|
if g.Alloc != nil { |
|
|
|
enc.Alloc = make(map[common.UnprefixedAddress]GenesisAccount, len(g.Alloc)) |
|
|
|
enc.Alloc = make(map[common.UnprefixedAddress]GenesisAccount, len(g.Alloc)) |
|
|
|
for k, v := range g.Alloc { |
|
|
|
for k, v := range g.Alloc { |
|
|
@ -49,24 +47,24 @@ func (g *Genesis) MarshalJSON() ([]byte, error) { |
|
|
|
|
|
|
|
|
|
|
|
func (g *Genesis) UnmarshalJSON(input []byte) error { |
|
|
|
func (g *Genesis) UnmarshalJSON(input []byte) error { |
|
|
|
type GenesisJSON struct { |
|
|
|
type GenesisJSON struct { |
|
|
|
ChainConfig *params.ChainConfig `json:"config" optional:"true"` |
|
|
|
Config *params.ChainConfig `json:"config" optional:"true"` |
|
|
|
Nonce *math.HexOrDecimal64 `json:"nonce" optional:"true"` |
|
|
|
Nonce *math.HexOrDecimal64 `json:"nonce" optional:"true"` |
|
|
|
Timestamp *math.HexOrDecimal64 `json:"timestamp" optional:"true"` |
|
|
|
Timestamp *math.HexOrDecimal64 `json:"timestamp" optional:"true"` |
|
|
|
ParentHash *common.Hash `json:"parentHash" optional:"true"` |
|
|
|
ParentHash *common.Hash `json:"parentHash" optional:"true"` |
|
|
|
ExtraData hexutil.Bytes `json:"extraData" optional:"true"` |
|
|
|
ExtraData hexutil.Bytes `json:"extraData" optional:"true"` |
|
|
|
GasLimit *math.HexOrDecimal64 `json:"gasLimit"` |
|
|
|
GasLimit *math.HexOrDecimal64 `json:"gasLimit"` |
|
|
|
Difficulty *math.HexOrDecimal256 `json:"difficulty"` |
|
|
|
Difficulty *math.HexOrDecimal256 `json:"difficulty"` |
|
|
|
Mixhash *common.Hash `json:"mixHash" optional:"true"` |
|
|
|
Mixhash *common.Hash `json:"mixHash" optional:"true"` |
|
|
|
Coinbase *common.Address `json:"coinbase" optional:"true"` |
|
|
|
Coinbase *common.Address `json:"coinbase" optional:"true"` |
|
|
|
Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"` |
|
|
|
Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"` |
|
|
|
} |
|
|
|
} |
|
|
|
var dec GenesisJSON |
|
|
|
var dec GenesisJSON |
|
|
|
if err := json.Unmarshal(input, &dec); err != nil { |
|
|
|
if err := json.Unmarshal(input, &dec); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
var x Genesis |
|
|
|
var x Genesis |
|
|
|
if dec.ChainConfig != nil { |
|
|
|
if dec.Config != nil { |
|
|
|
x.Config = dec.ChainConfig |
|
|
|
x.Config = dec.Config |
|
|
|
} |
|
|
|
} |
|
|
|
if dec.Nonce != nil { |
|
|
|
if dec.Nonce != nil { |
|
|
|
x.Nonce = uint64(*dec.Nonce) |
|
|
|
x.Nonce = uint64(*dec.Nonce) |
|
|
|