diff options
author | Wei-Ning Huang <w@byzantine-lab.io> | 2019-10-02 13:44:20 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-10-03 11:22:29 +0800 |
commit | 14336500ee38c2bc0b61a7133335df593aba4a46 (patch) | |
tree | 79a621d8c793da30330c658c95f3795185e75612 /core | |
parent | 06593b0859becced6dd5441e4b3c0680f0a075b1 (diff) | |
download | go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar.gz go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar.bz2 go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar.lz go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar.xz go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.tar.zst go-tangerine-14336500ee38c2bc0b61a7133335df593aba4a46.zip |
build: ci: fix testsw-ci
Diffstat (limited to 'core')
-rw-r--r-- | core/block_validator.go | 3 | ||||
-rw-r--r-- | core/evm.go | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/block_validator.go b/core/block_validator.go index 1bb6aafa2..b91981e33 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -111,8 +111,7 @@ func (v *BlockValidator) ValidateWitnessData(height uint64, blockHash common.Has } if b.Hash() != blockHash { - log.Error("invalid witness block %s vs %s", - b.Hash().String(), blockHash.String()) + log.Error("invalid witness block", "first", b.Hash().String(), "second", blockHash.String()) return consensus.ErrWitnessMismatch } return nil diff --git a/core/evm.go b/core/evm.go index 3a0c0e7f8..822859572 100644 --- a/core/evm.go +++ b/core/evm.go @@ -55,6 +55,11 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author beneficiary = *author } + ts := header.Time + if !*legacyEvm { + ts /= 1000 + } + return vm.Context{ CanTransfer: CanTransfer, Transfer: Transfer, @@ -64,7 +69,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 / 1000), // seconds. + Time: new(big.Int).SetUint64(ts), Randomness: header.Randomness, Difficulty: new(big.Int).Set(header.Difficulty), Round: new(big.Int).SetUint64(header.Round), |