aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2017-12-22 20:37:50 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-12-22 20:37:50 +0800
commit5f8888e11606296c9582496974c0f6b96a882146 (patch)
treeef8139ff20ae33eb5a236290d5107dd808e34340 /les
parent9dbb8ef4aadb8e40aef8b681cf86acd20789abdc (diff)
downloadgo-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar.gz
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar.bz2
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar.lz
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar.xz
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.tar.zst
go-tangerine-5f8888e11606296c9582496974c0f6b96a882146.zip
accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)
* accounts, consensus, core, eth: make chain maker consensus agnostic * consensus, core: move CalcDifficulty to Engine interface * consensus: add docs for calcDifficulty function * consensus, core: minor comment fixups
Diffstat (limited to 'les')
-rw-r--r--les/handler_test.go5
-rw-r--r--les/helper_test.go2
2 files changed, 4 insertions, 3 deletions
diff --git a/les/handler_test.go b/les/handler_test.go
index a9dac89b4..6207061cc 100644
--- a/les/handler_test.go
+++ b/les/handler_test.go
@@ -24,6 +24,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
@@ -459,7 +460,7 @@ func TestTransactionStatusLes2(t *testing.T) {
test(tx3, false, txStatus{Status: core.TxStatusPending})
// generate and add a block with tx1 and tx2 included
- gchain, _ := core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), db, 1, func(i int, block *core.BlockGen) {
+ gchain, _ := core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), db, 1, func(i int, block *core.BlockGen) {
block.AddTx(tx1)
block.AddTx(tx2)
})
@@ -483,7 +484,7 @@ func TestTransactionStatusLes2(t *testing.T) {
test(tx2, false, txStatus{Status: core.TxStatusIncluded, Lookup: &core.TxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 1}})
// create a reorg that rolls them back
- gchain, _ = core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), db, 2, func(i int, block *core.BlockGen) {})
+ gchain, _ = core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), db, 2, func(i int, block *core.BlockGen) {})
if _, err := chain.InsertChain(gchain); err != nil {
panic(err)
}
diff --git a/les/helper_test.go b/les/helper_test.go
index a06f84cca..92a98e27e 100644
--- a/les/helper_test.go
+++ b/les/helper_test.go
@@ -149,7 +149,7 @@ func newTestProtocolManager(lightSync bool, blocks int, generator func(int, *cor
chain, _ = light.NewLightChain(odr, gspec.Config, engine)
} else {
blockchain, _ := core.NewBlockChain(db, gspec.Config, engine, vm.Config{})
- gchain, _ := core.GenerateChain(gspec.Config, genesis, db, blocks, generator)
+ gchain, _ := core.GenerateChain(gspec.Config, genesis, ethash.NewFaker(), db, blocks, generator)
if _, err := blockchain.InsertChain(gchain); err != nil {
panic(err)
}