aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-13 16:48:50 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:49:52 +0800
commitb12ac4fda0c31d037a070ec3841c639f0bd48c16 (patch)
treefa41492e377cb2ec54bfb8b41b2c60dd8f0ba15a /core
parentefbf1cfb810fd80819df901526052159e4743680 (diff)
downloaddexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar.gz
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar.bz2
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar.lz
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar.xz
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.tar.zst
dexon-b12ac4fda0c31d037a070ec3841c639f0bd48c16.zip
core: populate genesis CRS in genesis state
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 043a9f428..04da8960c 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -32,6 +32,7 @@ import (
"github.com/dexon-foundation/dexon/core/state"
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/core/vm"
+ "github.com/dexon-foundation/dexon/crypto"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/log"
"github.com/dexon-foundation/dexon/params"
@@ -253,6 +254,10 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
// Governance configuration.
govStateHelper.UpdateConfiguration(g.Config.Dexcon)
+ // Genesis CRS.
+ crs := crypto.Keccak256([]byte(g.Config.Dexcon.GenesisCRSText))
+ govStateHelper.PushCRS(common.BytesToHash(crs))
+
root := statedb.IntermediateRoot(false)
head := &types.Header{
Number: new(big.Int).SetUint64(g.Number),