diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-04-05 06:16:29 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-04-05 06:16:29 +0800 |
commit | 09777952ee476ff80d4b6e63b5041ff5ca0e441b (patch) | |
tree | e85320f88f548201e3476b3e7095e96fd071617b /light/odr_test.go | |
parent | e50a5b77712d891ff409aa942a5cbc24e721b332 (diff) | |
download | dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.gz dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.bz2 dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.lz dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.xz dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.zst dexon-09777952ee476ff80d4b6e63b5041ff5ca0e441b.zip |
core, consensus: pluggable consensus engines (#3817)
This commit adds pluggable consensus engines to go-ethereum. In short, it
introduces a generic consensus interface, and refactors the entire codebase to
use this interface.
Diffstat (limited to 'light/odr_test.go')
-rw-r--r-- | light/odr_test.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/light/odr_test.go b/light/odr_test.go index 37d999994..ca33db246 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" @@ -34,7 +35,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/pow" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" ) @@ -248,7 +248,6 @@ func testChainGen(i int, block *core.BlockGen) { func testChainOdr(t *testing.T, protocol int, expFail uint64, fn odrTestFn) { var ( evmux = new(event.TypeMux) - pow = new(pow.FakePow) sdb, _ = ethdb.NewMemDatabase() ldb, _ = ethdb.NewMemDatabase() gspec = core.Genesis{Alloc: core.GenesisAlloc{testBankAddress: {Balance: testBankFunds}}} @@ -256,16 +255,14 @@ func testChainOdr(t *testing.T, protocol int, expFail uint64, fn odrTestFn) { ) gspec.MustCommit(ldb) // Assemble the test environment - blockchain, _ := core.NewBlockChain(sdb, testChainConfig(), pow, evmux, vm.Config{}) - chainConfig := ¶ms.ChainConfig{HomesteadBlock: new(big.Int)} - gchain, _ := core.GenerateChain(chainConfig, genesis, sdb, 4, testChainGen) + blockchain, _ := core.NewBlockChain(sdb, params.TestChainConfig, ethash.NewFullFaker(), evmux, vm.Config{}) + gchain, _ := core.GenerateChain(params.TestChainConfig, genesis, sdb, 4, testChainGen) if _, err := blockchain.InsertChain(gchain); err != nil { panic(err) } odr := &testOdr{sdb: sdb, ldb: ldb} - lightchain, _ := NewLightChain(odr, testChainConfig(), pow, evmux) - lightchain.SetValidator(bproc{}) + lightchain, _ := NewLightChain(odr, params.TestChainConfig, ethash.NewFullFaker(), evmux) headers := make([]*types.Header, len(gchain)) for i, block := range gchain { headers[i] = block.Header() |