mempool

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package mempool is a generated GoMock package.

Index

Constants

View Source
const (
	// MaxTxSize is the maximum number of bytes a transaction can use to be
	// allowed into the mempool.
	MaxTxSize = 64 * units.KiB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mempool

type Mempool interface {
	Add(tx *txs.Tx) error
	Has(txID ids.ID) bool
	Get(txID ids.ID) *txs.Tx
	Remove(txs []*txs.Tx)

	// Peek returns the next first tx that was added to the mempool whose size
	// is less than or equal to maxTxSize.
	Peek(maxTxSize int) *txs.Tx

	// RequestBuildBlock notifies the consensus engine that a block should be
	// built if there is at least one transaction in the mempool.
	RequestBuildBlock()

	// Note: Dropped txs are added to droppedTxIDs but not evicted from
	// unissued. This allows previously dropped txs to be possibly reissued.
	MarkDropped(txID ids.ID, reason error)
	GetDropReason(txID ids.ID) error
}

Mempool contains transactions that have not yet been put into a block.

func New

func New(
	namespace string,
	registerer prometheus.Registerer,
	toEngine chan<- common.Message,
) (Mempool, error)

type MockMempool

type MockMempool struct {
	// contains filtered or unexported fields
}

MockMempool is a mock of Mempool interface.

func NewMockMempool

func NewMockMempool(ctrl *gomock.Controller) *MockMempool

NewMockMempool creates a new mock instance.

func (*MockMempool) Add

func (m *MockMempool) Add(arg0 *txs.Tx) error

Add mocks base method.

func (*MockMempool) EXPECT

func (m *MockMempool) EXPECT() *MockMempoolMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMempool) Get

func (m *MockMempool) Get(arg0 ids.ID) *txs.Tx

Get mocks base method.

func (*MockMempool) GetDropReason

func (m *MockMempool) GetDropReason(arg0 ids.ID) error

GetDropReason mocks base method.

func (*MockMempool) Has

func (m *MockMempool) Has(arg0 ids.ID) bool

Has mocks base method.

func (*MockMempool) MarkDropped

func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error)

MarkDropped mocks base method.

func (*MockMempool) Peek

func (m *MockMempool) Peek(arg0 int) *txs.Tx

Peek mocks base method.

func (*MockMempool) Remove

func (m *MockMempool) Remove(arg0 []*txs.Tx)

Remove mocks base method.

func (*MockMempool) RequestBuildBlock

func (m *MockMempool) RequestBuildBlock()

RequestBuildBlock mocks base method.

type MockMempoolMockRecorder

type MockMempoolMockRecorder struct {
	// contains filtered or unexported fields
}

MockMempoolMockRecorder is the mock recorder for MockMempool.

func (*MockMempoolMockRecorder) Add

func (mr *MockMempoolMockRecorder) Add(arg0 interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockMempoolMockRecorder) Get

func (mr *MockMempoolMockRecorder) Get(arg0 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockMempoolMockRecorder) GetDropReason

func (mr *MockMempoolMockRecorder) GetDropReason(arg0 interface{}) *gomock.Call

GetDropReason indicates an expected call of GetDropReason.

func (*MockMempoolMockRecorder) Has

func (mr *MockMempoolMockRecorder) Has(arg0 interface{}) *gomock.Call

Has indicates an expected call of Has.

func (*MockMempoolMockRecorder) MarkDropped

func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 interface{}) *gomock.Call

MarkDropped indicates an expected call of MarkDropped.

func (*MockMempoolMockRecorder) Peek

func (mr *MockMempoolMockRecorder) Peek(arg0 interface{}) *gomock.Call

Peek indicates an expected call of Peek.

func (*MockMempoolMockRecorder) Remove

func (mr *MockMempoolMockRecorder) Remove(arg0 interface{}) *gomock.Call

Remove indicates an expected call of Remove.

func (*MockMempoolMockRecorder) RequestBuildBlock

func (mr *MockMempoolMockRecorder) RequestBuildBlock() *gomock.Call

RequestBuildBlock indicates an expected call of RequestBuildBlock.

Jump to

Keyboard shortcuts

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