aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.go
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-03-12 12:19:09 +0800
commitf4936aa1eb7fa01f56c28f081af266c2a4924a61 (patch)
tree1b6a801a3e0deb4b812d6f4ffeac48e0005e436f /core/genesis.go
parent0e24664c5a4133e8404868bdc83f4a3da8806ab8 (diff)
downloaddexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.gz
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.bz2
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.lz
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.xz
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.zst
dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.zip
core: populate genesis CRS in genesis state
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 94b1deff2..945476d6a 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),