all: refactor txpool into it's own package in prep for 4844

This commit is contained in:
Péter Szilágyi
2022-10-24 16:35:53 +03:00
parent 5f70f9fd37
commit a6dda03644
35 changed files with 408 additions and 385 deletions
+4 -3
View File
@@ -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),
}
}