diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-13 16:48:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 0f649b2cb78a3f35b870b2db94a92ec9297886b6 (patch) | |
tree | 7ca44acd0b0f631f2c78eb7680c0645abd18f72d /core | |
parent | 411758e3b2215a3baf324a1df3495ffcbdc8ecd6 (diff) | |
download | dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar.gz dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar.bz2 dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar.lz dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar.xz dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.tar.zst dexon-0f649b2cb78a3f35b870b2db94a92ec9297886b6.zip |
core: populate genesis CRS in genesis state
Diffstat (limited to 'core')
-rw-r--r-- | core/genesis.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go index a6989ce23..3d957f265 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), |