mock

package
v0.0.0-...-1f8a15b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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

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 tx 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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL