From aa9c5b22941aadfefcde64d2570d6c6863bc2ebe Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Sun, 16 Jun 2019 17:15:00 +0800 Subject: core: set block timestamp to second instead of millisecond --- core/evm.go | 2 +- core/vm/oracle_contracts_test.go | 2 +- params/config.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/evm.go b/core/evm.go index fcc3cd93e..3a0c0e7f8 100644 --- a/core/evm.go +++ b/core/evm.go @@ -64,7 +64,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author Origin: msg.From(), Coinbase: beneficiary, BlockNumber: new(big.Int).Set(header.Number), - Time: new(big.Int).SetUint64(header.Time), + Time: new(big.Int).SetUint64(header.Time / 1000), // seconds. Randomness: header.Randomness, Difficulty: new(big.Int).Set(header.Difficulty), Round: new(big.Int).SetUint64(header.Round), diff --git a/core/vm/oracle_contracts_test.go b/core/vm/oracle_contracts_test.go index 7c892ac10..33fdba886 100644 --- a/core/vm/oracle_contracts_test.go +++ b/core/vm/oracle_contracts_test.go @@ -182,7 +182,7 @@ func (g *OracleContractsTestSuite) SetupTest() { g.s = &GovernanceState{stateDB} config := params.TestnetChainConfig.Dexcon - config.LockupPeriod = 1000 + config.LockupPeriod = 1 config.NextHalvingSupply = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2.5e9)) config.LastHalvedAmount = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.5e9)) config.MiningVelocity = 0.1875 diff --git a/params/config.go b/params/config.go index b0ed002ee..a7394fd0d 100644 --- a/params/config.go +++ b/params/config.go @@ -56,7 +56,7 @@ var ( GenesisCRSText: "In DEXON, we trust.", Owner: common.HexToAddress("0x2D9f82B399113De36c718BEf361528a856208057"), MinStake: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e6)), - LockupPeriod: 86400 * 1000, + LockupPeriod: 86400, MiningVelocity: 0.1875, NextHalvingSupply: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2.5e9)), LastHalvedAmount: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.5e9)), @@ -100,7 +100,7 @@ var ( GenesisCRSText: "OOOOoooooooooooooooooooooooooooo", Owner: common.HexToAddress("0x0D54AF942d6bF13870F5CA65D470954f21D3cBE5"), MinStake: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e6)), - LockupPeriod: 86400 * 1000, + LockupPeriod: 86400, MiningVelocity: 0.1875, NextHalvingSupply: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2.5e9)), LastHalvedAmount: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.5e9)), -- cgit v1.2.3