mempool

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package mempool is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockTimer

type BlockTimer interface {
	// ResetBlockTimer schedules a timer to notify the consensus engine once
	// there is a block ready to be built. If a block is ready to be built when
	// this function is called, the engine will be notified directly.
	ResetBlockTimer()
}

type Mempool

type Mempool interface {
	// we may want to be able to stop valid transactions
	// from entering the mempool, e.g. during blocks creation
	EnableAdding()
	DisableAdding()

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

	// Following Banff activation, all mempool transactions,
	// (both decision and staker) are included into Standard blocks.
	// HasTxs allow to check for availability of any mempool transaction.
	HasTxs() bool
	// PeekTxs returns the next txs for Banff blocks
	// up to maxTxsBytes without removing them from the mempool.
	PeekTxs(maxTxsBytes int) []*txs.Tx

	HasStakerTx() bool
	// PeekStakerTx returns the next stakerTx without removing it from mempool.
	// It returns nil if !HasStakerTx().
	// It's guaranteed that the returned tx, if not nil, is a StakerTx.
	PeekStakerTx() *txs.Tx

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

func NewMempool

func NewMempool(
	namespace string,
	registerer prometheus.Registerer,
	blkTimer BlockTimer,
) (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) DisableAdding

func (m *MockMempool) DisableAdding()

DisableAdding 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) EnableAdding

func (m *MockMempool) EnableAdding()

EnableAdding mocks base method.

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) HasStakerTx

func (m *MockMempool) HasStakerTx() bool

HasStakerTx mocks base method.

func (*MockMempool) HasTxs

func (m *MockMempool) HasTxs() bool

HasTxs mocks base method.

func (*MockMempool) MarkDropped

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

MarkDropped mocks base method.

func (*MockMempool) PeekStakerTx

func (m *MockMempool) PeekStakerTx() *txs.Tx

PeekStakerTx mocks base method.

func (*MockMempool) PeekTxs

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

PeekTxs mocks base method.

func (*MockMempool) Remove

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

Remove 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) DisableAdding

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

DisableAdding indicates an expected call of DisableAdding.

func (*MockMempoolMockRecorder) EnableAdding

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

EnableAdding indicates an expected call of EnableAdding.

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) HasStakerTx

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

HasStakerTx indicates an expected call of HasStakerTx.

func (*MockMempoolMockRecorder) HasTxs

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

HasTxs indicates an expected call of HasTxs.

func (*MockMempoolMockRecorder) MarkDropped

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

MarkDropped indicates an expected call of MarkDropped.

func (*MockMempoolMockRecorder) PeekStakerTx

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

PeekStakerTx indicates an expected call of PeekStakerTx.

func (*MockMempoolMockRecorder) PeekTxs

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

PeekTxs indicates an expected call of PeekTxs.

func (*MockMempoolMockRecorder) Remove

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

Remove indicates an expected call of Remove.

Jump to

Keyboard shortcuts

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