forked from cerc-io/plugeth
all: refactor txpool into it's own package in prep for 4844
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/txpool"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
@@ -50,7 +51,7 @@ var (
|
||||
type testBackend struct {
|
||||
db ethdb.Database
|
||||
chain *core.BlockChain
|
||||
txpool *core.TxPool
|
||||
txpool *txpool.TxPool
|
||||
}
|
||||
|
||||
// newTestBackend creates an empty chain and wraps it into a mock backend.
|
||||
@@ -76,13 +77,13 @@ func newTestBackendWithGenerator(blocks int, generator func(int, *core.BlockGen)
|
||||
for _, block := range bs {
|
||||
chain.StateCache().TrieDB().Commit(block.Root(), false, nil)
|
||||
}
|
||||
txconfig := core.DefaultTxPoolConfig
|
||||
txconfig := txpool.DefaultConfig
|
||||
txconfig.Journal = "" // Don't litter the disk with test journals
|
||||
|
||||
return &testBackend{
|
||||
db: db,
|
||||
chain: chain,
|
||||
txpool: core.NewTxPool(txconfig, params.TestChainConfig, chain),
|
||||
txpool: txpool.NewTxPool(txconfig, params.TestChainConfig, chain),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user