aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@byzantine-lab.io>2019-06-16 17:15:00 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-09-17 16:57:30 +0800
commitaa9c5b22941aadfefcde64d2570d6c6863bc2ebe (patch)
tree59c0c63e4a7f85c4d804d872d4b3aaea29305026 /core
parent0f7b223fa10ec41f1d2342d3b5de9a9f6a7432ce (diff)
downloadgo-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.gz
go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.tar.zst
go-tangerine-aa9c5b22941aadfefcde64d2570d6c6863bc2ebe.zip
core: set block timestamp to second instead of millisecond
Diffstat (limited to 'core')
-rw-r--r--core/evm.go2
-rw-r--r--core/vm/oracle_contracts_test.go2
2 files changed, 2 insertions, 2 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