diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-13 16:48:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:49 +0800 |
commit | cdf1f022696971d9d6209d577ed0b578e7462007 (patch) | |
tree | 3d88cc5befb29d3c64fb3607adbeb01ff43d32eb /core | |
parent | 7574700a4ccd20bc15c3ba28f1671eb66769e8bc (diff) | |
download | dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar.gz dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar.bz2 dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar.lz dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar.xz dexon-cdf1f022696971d9d6209d577ed0b578e7462007.tar.zst dexon-cdf1f022696971d9d6209d577ed0b578e7462007.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 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), |