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 14:52:28 +0800 |
commit | d3e0eca00b8bf09b491b7404004dbc67e3eb904d (patch) | |
tree | 805c6e445eddd42b2dee03e86c7af2fde3901497 | |
parent | 6675923a8ed9f6abdaad6505e402b0b9c59fd529 (diff) | |
download | go-tangerine-d3e0eca00b8bf09b491b7404004dbc67e3eb904d.tar.gz go-tangerine-d3e0eca00b8bf09b491b7404004dbc67e3eb904d.tar.zst go-tangerine-d3e0eca00b8bf09b491b7404004dbc67e3eb904d.zip |
build: ci: fix tests
-rw-r--r-- | build/ci.go | 2 | ||||
-rw-r--r-- | core/block_validator.go | 3 | ||||
-rw-r--r-- | core/evm.go | 7 | ||||
-rw-r--r-- | params/config.go | 4 | ||||
-rwxr-xr-x | test/run_test.sh | 4 | ||||
m--------- | tests/testdata | 0 |
6 files changed, 13 insertions, 7 deletions
diff --git a/build/ci.go b/build/ci.go index ea9fddd03..f8b2253bb 100644 --- a/build/ci.go +++ b/build/ci.go @@ -336,7 +336,7 @@ func doTest(cmdline []string) { packageForLegacyEvm := []string{} for i := 0; i < len(packages); i++ { - if strings.HasSuffix(packages[i], "dexon/tests") { + if strings.HasSuffix(packages[i], "go-tangerine/tests") { packageForLegacyEvm = append(packageForLegacyEvm, packages[i]) packages = append(packages[:i], packages[i+1:]...) i-- 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), diff --git a/params/config.go b/params/config.go index 595130f47..b1f79dd67 100644 --- a/params/config.go +++ b/params/config.go @@ -175,7 +175,8 @@ var ( EIP155Block: big.NewInt(2675000), EIP158Block: big.NewInt(2675000), ByzantiumBlock: big.NewInt(4370000), - ConstantinopleBlock: nil, + ConstantinopleBlock: big.NewInt(7280000), + PetersburgBlock: big.NewInt(7280000), Ethash: new(EthashConfig), } @@ -192,6 +193,7 @@ var ( EIP158Block: big.NewInt(10), ByzantiumBlock: big.NewInt(1700000), ConstantinopleBlock: big.NewInt(4230000), + PetersburgBlock: big.NewInt(4939394), Ethash: new(EthashConfig), } ) diff --git a/test/run_test.sh b/test/run_test.sh index 181f8b755..02129050f 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash cd "$(dirname "$0")" @@ -104,7 +104,7 @@ for i in $(seq 0 $(($NUM_NODES - 1))); do $GDEX \ ${BOOTNODE_FLAGS} \ --bp \ - --verbosity=4 \ + --verbosity=3 \ --nat=none \ --gcmode=archive \ --datadir=$datadir --nodekey=keystore/test$i.key \ diff --git a/tests/testdata b/tests/testdata -Subproject f00f058a9518e908ebb6d577a7a875198c0a37c +Subproject 6b85703b568f4456582a00665d8a3e5c3b20b48 |