diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-03-06 02:00:01 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-03-09 22:50:14 +0800 |
commit | 567d41d9363706b4b13ce0903804e8acf214af49 (patch) | |
tree | 8c091f0385589074573df3f7964c99417c5950ee /eth | |
parent | 3b00a77de57ab2737a7887521c192ce004c721e3 (diff) | |
download | dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar.gz dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar.bz2 dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar.lz dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar.xz dexon-567d41d9363706b4b13ce0903804e8acf214af49.tar.zst dexon-567d41d9363706b4b13ce0903804e8acf214af49.zip |
all: swap out the C++ ethash to the pure Go one (mining todo)
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 8 | ||||
-rw-r--r-- | eth/handler_test.go | 3 | ||||
-rw-r--r-- | eth/helper_test.go | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go index 5a8b41f5d..024520b13 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -288,15 +288,15 @@ func CreatePoW(config *Config) (pow.PoW, error) { switch { case config.PowFake: log.Warn("Ethash used in fake mode") - return pow.PoW(core.FakePow{}), nil + return pow.FakePow{}, nil case config.PowTest: log.Warn("Ethash used in test mode") - return ethash.NewForTesting() + return pow.NewTestEthash(), nil case config.PowShared: log.Warn("Ethash used in shared mode") - return ethash.NewShared(), nil + return pow.NewSharedEthash(), nil default: - return ethash.New(), nil + return pow.NewFullEthash("", ""), nil } } diff --git a/eth/handler_test.go b/eth/handler_test.go index 03d5404a4..683c8f71e 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -34,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/pow" ) var bigTxGas = new(big.Int).SetUint64(params.TxGas) @@ -468,7 +469,7 @@ func testDAOChallenge(t *testing.T, localForked, remoteForked bool, timeout bool // Create a DAO aware protocol manager var ( evmux = new(event.TypeMux) - pow = new(core.FakePow) + pow = new(pow.FakePow) db, _ = ethdb.NewMemDatabase() genesis = core.WriteGenesisBlockForTesting(db) config = ¶ms.ChainConfig{DAOForkBlock: big.NewInt(1), DAOForkSupport: localForked} diff --git a/eth/helper_test.go b/eth/helper_test.go index 0861c884b..3ad31394a 100644 --- a/eth/helper_test.go +++ b/eth/helper_test.go @@ -37,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/pow" ) var ( @@ -53,7 +54,7 @@ var ( func newTestProtocolManager(fastSync bool, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, error) { var ( evmux = new(event.TypeMux) - pow = new(core.FakePow) + pow = new(pow.FakePow) db, _ = ethdb.NewMemDatabase() genesis = core.WriteGenesisBlockForTesting(db, testBank) chainConfig = ¶ms.ChainConfig{HomesteadBlock: big.NewInt(0)} // homestead set to 0 because of chain maker |