aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-02-25 16:41:05 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:57 +0800
commit6e66efc9f69d59a011215f88a0de03508d9c56ab (patch)
tree096c2ad2da556aebfcb6fc7a16bdb528b9adf044 /core
parent94477130cc35bd196b23267b4be130668a13b74c (diff)
downloaddexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar.gz
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar.bz2
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar.lz
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar.xz
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.tar.zst
dexon-6e66efc9f69d59a011215f88a0de03508d9c56ab.zip
core: set oracle contract's code (#209)
So that other contract can call oracle contract.
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go5
-rw-r--r--core/genesis_test.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/core/genesis.go b/core/genesis.go
index c378c0ab2..40e8a06bf 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -329,6 +329,11 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
govStateHelper.IncTotalSupply(totalSupply)
}
+ // Set oracle contract.
+ for address := range vm.OracleContracts {
+ statedb.SetCode(address, []byte{0xed})
+ }
+
root := statedb.IntermediateRoot(false)
head := &types.Header{
Number: new(big.Int).SetUint64(g.Number),
diff --git a/core/genesis_test.go b/core/genesis_test.go
index 267086f9b..9db96c271 100644
--- a/core/genesis_test.go
+++ b/core/genesis_test.go
@@ -43,7 +43,7 @@ func TestDefaultGenesisBlock(t *testing.T) {
func TestSetupGenesis(t *testing.T) {
var (
- customghash = common.HexToHash("0xe19bf9c49cae55e72edfdfa9f4ef867defeb3747de25102740b7cebc5b9cdb1a")
+ customghash = common.HexToHash("0xbd64608d51b78fd61aeb6d91669fd3ff09c12c7552f0923b0c2d19910887efda")
customg = Genesis{
Config: &params.ChainConfig{HomesteadBlock: big.NewInt(3)},
Alloc: GenesisAlloc{