diff options
author | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-16 17:15:00 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-09-17 16:57:30 +0800 |
commit | aa9c5b22941aadfefcde64d2570d6c6863bc2ebe (patch) | |
tree | 59c0c63e4a7f85c4d804d872d4b3aaea29305026 | |
parent | 0f7b223fa10ec41f1d2342d3b5de9a9f6a7432ce (diff) | |
download | go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.gz go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.bz2 go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.lz go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.xz go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.zst go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.zip |
core: set block timestamp to second instead of millisecond
-rw-r--r-- | core/evm.go | 2 | ||||
-rw-r--r-- | core/vm/oracle_contracts_test.go | 2 | ||||
-rw-r--r-- | 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)), |