From 1756fa0135920beb749c313bdd966497bc1bff28 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Tue, 6 Nov 2018 22:12:40 +0800 Subject: core: vm: governance: add node info --- core/gen_genesis_account.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/gen_genesis_account.go') diff --git a/core/gen_genesis_account.go b/core/gen_genesis_account.go index 1a5653e4b..15393d978 100644 --- a/core/gen_genesis_account.go +++ b/core/gen_genesis_account.go @@ -23,6 +23,7 @@ func (g GenesisAccount) MarshalJSON() ([]byte, error) { Nonce math.HexOrDecimal64 `json:"nonce,omitempty"` Staked *math.HexOrDecimal256 `json:"staked"` PublicKey hexutil.Bytes `json:"publicKey"` + NodeInfo NodeInfo `json:"info"` PrivateKey hexutil.Bytes `json:"secretKey,omitempty"` } var enc GenesisAccount @@ -37,6 +38,7 @@ func (g GenesisAccount) MarshalJSON() ([]byte, error) { enc.Nonce = math.HexOrDecimal64(g.Nonce) enc.Staked = (*math.HexOrDecimal256)(g.Staked) enc.PublicKey = g.PublicKey + enc.NodeInfo = g.NodeInfo enc.PrivateKey = g.PrivateKey return json.Marshal(&enc) } @@ -50,6 +52,7 @@ func (g *GenesisAccount) UnmarshalJSON(input []byte) error { Nonce *math.HexOrDecimal64 `json:"nonce,omitempty"` Staked *math.HexOrDecimal256 `json:"staked"` PublicKey *hexutil.Bytes `json:"publicKey"` + NodeInfo *NodeInfo `json:"info"` PrivateKey *hexutil.Bytes `json:"secretKey,omitempty"` } var dec GenesisAccount @@ -78,6 +81,9 @@ func (g *GenesisAccount) UnmarshalJSON(input []byte) error { if dec.PublicKey != nil { g.PublicKey = *dec.PublicKey } + if dec.NodeInfo != nil { + g.NodeInfo = *dec.NodeInfo + } if dec.PrivateKey != nil { g.PrivateKey = *dec.PrivateKey } -- cgit