aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-02-25 16:41:05 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:22 +0800
commitf1a3f3a8f39d5490f4320591def9c2866d866bc4 (patch)
tree6cc23e1c786baf3ec049cb171bf0a2d6abd3c30a
parent3c29f8b33e108c2cd4f1b8d269742d2e5adce669 (diff)
downloadgo-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar.gz
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar.bz2
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar.lz
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar.xz
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.tar.zst
go-tangerine-f1a3f3a8f39d5490f4320591def9c2866d866bc4.zip
core: set oracle contract's code (#209)
So that other contract can call oracle contract.
-rw-r--r--cmd/gdex/dao_test.go2
-rw-r--r--core/genesis.go5
-rw-r--r--core/genesis_test.go2
-rw-r--r--params/config.go4
4 files changed, 9 insertions, 4 deletions
diff --git a/cmd/gdex/dao_test.go b/cmd/gdex/dao_test.go
index 2d383ba10..9a768c3fc 100644
--- a/cmd/gdex/dao_test.go
+++ b/cmd/gdex/dao_test.go
@@ -77,7 +77,7 @@ var daoProForkGenesis = `{
}
}`
-var daoGenesisHash = common.HexToHash("0x81e17c54ca08eb60d9455df5600813b637fc460b86ccbd6ac322fb2d2bd2a935")
+var daoGenesisHash = common.HexToHash("0x917e74766af045b81b7e45650fc40af9bd41282eaaac7ec3f89d8f10d82f434e")
var daoGenesisForkBlock = big.NewInt(314)
// TestDAOForkBlockNewChain tests that the DAO hard-fork number and the nodes support/opposition is correctly
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{
diff --git a/params/config.go b/params/config.go
index c109e6ac7..937234c84 100644
--- a/params/config.go
+++ b/params/config.go
@@ -26,8 +26,8 @@ import (
// Genesis hashes to enforce below configs on.
var (
- MainnetGenesisHash = common.HexToHash("0x09fd8e9d8db083831e0793a41643721d5becc0f9742b5344021a06b20b5a7fed")
- TestnetGenesisHash = common.HexToHash("0x713fca1f1a31ad516f05945ae9bc1455c39d442db57c9f3c85ee593cc40ea239")
+ MainnetGenesisHash = common.HexToHash("0x6c59132f64eae33054c0390e4d8f8ea5f0df1642b3a084c94388c44fe5eff70d")
+ TestnetGenesisHash = common.HexToHash("0x31847855ec3c1ba9a03ac3311f283775a70d7b0422b525c335aa094e5b81c902")
)
// TrustedCheckpoints associates each known checkpoint with the genesis hash of