Documentation ¶
Index ¶
- type TestTxPool
- func (p *TestTxPool) AddLocals(txs []types.Transaction) []error
- func (p *TestTxPool) AddRemotes(txs []types.Transaction) []error
- func (p *TestTxPool) Content() (map[libcommon.Address]types.Transactions, ...)
- func (p *TestTxPool) CountContent() (pending uint, queued uint)
- func (p *TestTxPool) Get(hash libcommon.Hash) types.Transaction
- func (p *TestTxPool) Has(hash libcommon.Hash) bool
- func (p *TestTxPool) Pending() (types.TransactionsGroupedBySender, error)
- func (p *TestTxPool) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestTxPool ¶
type TestTxPool struct {
// contains filtered or unexported fields
}
TestTxPool is a mock transaction pool that blindly accepts all transactions. Its goal is to get around setting up a valid statedb for the balance and nonce checks.
func NewTestTxPool ¶
func NewTestTxPool() *TestTxPool
NewTestTxPool creates a mock transaction pool.
func (*TestTxPool) AddLocals ¶
func (p *TestTxPool) AddLocals(txs []types.Transaction) []error
func (*TestTxPool) AddRemotes ¶
func (p *TestTxPool) AddRemotes(txs []types.Transaction) []error
AddRemotes appends a batch of transactions to the pool, and notifies any listeners if the addition channel is non nil
func (*TestTxPool) Content ¶
func (p *TestTxPool) Content() (map[libcommon.Address]types.Transactions, map[libcommon.Address]types.Transactions)
Content returns all the transactions known to the pool
func (*TestTxPool) CountContent ¶
func (p *TestTxPool) CountContent() (pending uint, queued uint)
CountContent returns the number of pending and queued transactions in the transaction pool.
func (*TestTxPool) Get ¶
func (p *TestTxPool) Get(hash libcommon.Hash) types.Transaction
Get retrieves the transaction from local txpool with given txn hash.
func (*TestTxPool) Has ¶
func (p *TestTxPool) Has(hash libcommon.Hash) bool
Has returns an indicator whether txpool has a transaction cached with the given hash.
func (*TestTxPool) Pending ¶
func (p *TestTxPool) Pending() (types.TransactionsGroupedBySender, error)
Pending returns all the transactions known to the pool
func (*TestTxPool) SubscribeNewTxsEvent ¶
func (p *TestTxPool) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
SubscribeNewTxsEvent should return an event subscription of NewTxsEvent and send events to the given channel.