mempool

package
v1.8.0-rc.14 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: BSD-3-Clause Imports: 10 Imported by: 4

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)

	HasDecisionTxs() bool
	HasProposalTx() bool

	RemoveDecisionTxs(txs []*txs.Tx)
	RemoveProposalTx(tx *txs.Tx)

	PopDecisionTxs(maxTxsBytes int) []*txs.Tx
	PopProposalTx() *txs.Tx

	// PeekDecisionTxs returns the next decisionTxs
	// up to maxTxsBytes without removing them from the mempool.
	// It returns nil if !HasDecisionTxs()
	PeekDecisionTxs(maxTxsBytes int) []*txs.Tx

	// PeekProposalTx returns the next proposalTx
	// without removing it from mempool.
	// It returns nil if !HasProposalTx()
	PeekProposalTx() *txs.Tx

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

func NewMempool

func NewMempool(
	namespace string,
	registerer prometheus.Registerer,
	blkTimer BlockTimer,
) (Mempool, error)

type MockBlockTimer

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

MockBlockTimer is a mock of BlockTimer interface.

func NewMockBlockTimer

func NewMockBlockTimer(ctrl *gomock.Controller) *MockBlockTimer

NewMockBlockTimer creates a new mock instance.

func (*MockBlockTimer) EXPECT

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

func (*MockBlockTimer) ResetBlockTimer

func (m *MockBlockTimer) ResetBlockTimer()

ResetBlockTimer mocks base method.

type MockBlockTimerMockRecorder

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

MockBlockTimerMockRecorder is the mock recorder for MockBlockTimer.

func (*MockBlockTimerMockRecorder) ResetBlockTimer

func (mr *MockBlockTimerMockRecorder) ResetBlockTimer() *gomock.Call

ResetBlockTimer indicates an expected call of ResetBlockTimer.

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(tx *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(txID ids.ID) *txs.Tx

Get mocks base method.

func (*MockMempool) GetDropReason

func (m *MockMempool) GetDropReason(txID ids.ID) (string, bool)

GetDropReason mocks base method.

func (*MockMempool) Has

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

Has mocks base method.

func (*MockMempool) HasDecisionTxs

func (m *MockMempool) HasDecisionTxs() bool

HasDecisionTxs mocks base method.

func (*MockMempool) HasProposalTx

func (m *MockMempool) HasProposalTx() bool

HasProposalTx mocks base method.

func (*MockMempool) MarkDropped

func (m *MockMempool) MarkDropped(txID ids.ID, reason string)

MarkDropped mocks base method.

func (*MockMempool) PeekDecisionTxs

func (m *MockMempool) PeekDecisionTxs(maxTxsBytes int) []*txs.Tx

PeekDecisionTxs mocks base method.

func (*MockMempool) PeekProposalTx

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

PeekProposalTx mocks base method.

func (*MockMempool) PopDecisionTxs

func (m *MockMempool) PopDecisionTxs(maxTxsBytes int) []*txs.Tx

PopDecisionTxs mocks base method.

func (*MockMempool) PopProposalTx

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

PopProposalTx mocks base method.

func (*MockMempool) Remove added in v1.8.0

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

Remove mocks base method.

func (*MockMempool) RemoveDecisionTxs

func (m *MockMempool) RemoveDecisionTxs(txs []*txs.Tx)

RemoveDecisionTxs mocks base method.

func (*MockMempool) RemoveProposalTx

func (m *MockMempool) RemoveProposalTx(tx *txs.Tx)

RemoveProposalTx 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(tx 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(txID interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockMempoolMockRecorder) GetDropReason

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

GetDropReason indicates an expected call of GetDropReason.

func (*MockMempoolMockRecorder) Has

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

Has indicates an expected call of Has.

func (*MockMempoolMockRecorder) HasDecisionTxs

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

HasDecisionTxs indicates an expected call of HasDecisionTxs.

func (*MockMempoolMockRecorder) HasProposalTx

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

HasProposalTx indicates an expected call of HasProposalTx.

func (*MockMempoolMockRecorder) MarkDropped

func (mr *MockMempoolMockRecorder) MarkDropped(txID, reason interface{}) *gomock.Call

MarkDropped indicates an expected call of MarkDropped.

func (*MockMempoolMockRecorder) PeekDecisionTxs

func (mr *MockMempoolMockRecorder) PeekDecisionTxs(maxTxsBytes interface{}) *gomock.Call

PeekDecisionTxs indicates an expected call of PeekDecisionTxs.

func (*MockMempoolMockRecorder) PeekProposalTx

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

PeekProposalTx indicates an expected call of PeekProposalTx.

func (*MockMempoolMockRecorder) PopDecisionTxs

func (mr *MockMempoolMockRecorder) PopDecisionTxs(maxTxsBytes interface{}) *gomock.Call

PopDecisionTxs indicates an expected call of PopDecisionTxs.

func (*MockMempoolMockRecorder) PopProposalTx

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

PopProposalTx indicates an expected call of PopProposalTx.

func (*MockMempoolMockRecorder) Remove added in v1.8.0

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

Remove indicates an expected call of Remove.

func (*MockMempoolMockRecorder) RemoveDecisionTxs

func (mr *MockMempoolMockRecorder) RemoveDecisionTxs(txs interface{}) *gomock.Call

RemoveDecisionTxs indicates an expected call of RemoveDecisionTxs.

func (*MockMempoolMockRecorder) RemoveProposalTx

func (mr *MockMempoolMockRecorder) RemoveProposalTx(tx interface{}) *gomock.Call

RemoveProposalTx indicates an expected call of RemoveProposalTx.

Jump to

Keyboard shortcuts

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