diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-13 16:48:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | f4936aa1eb7fa01f56c28f081af266c2a4924a61 (patch) | |
tree | 1b6a801a3e0deb4b812d6f4ffeac48e0005e436f /core | |
parent | 0e24664c5a4133e8404868bdc83f4a3da8806ab8 (diff) | |
download | dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.gz dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.tar.zst dexon-f4936aa1eb7fa01f56c28f081af266c2a4924a61.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 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), |