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@byzantine-lab.io>2019-06-12 17:23:39 +0800
commit8250fd5357e8a9c4b634cf289489ce2c4ec3470c (patch)
tree3ce13f606486f0032b17579397551cafb2af5191 /core
parent3ac89bf83d2d65a5410692e0fe664a1a7c079055 (diff)
downloadgo-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar.gz
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar.bz2
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar.lz
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar.xz
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.tar.zst
go-tangerine-8250fd5357e8a9c4b634cf289489ce2c4ec3470c.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),