Documentation ¶
Overview ¶
Package mempool is a generated GoMock package.
Index ¶
- Constants
- func DropExpiredStakerTxs(mempool Mempool, minStartTime time.Time) []ids.ID
- type BlockTimer
- type Mempool
- type MockMempool
- func (m *MockMempool) Add(arg0 *txs.Tx) error
- func (m *MockMempool) DisableAdding()
- func (m *MockMempool) EXPECT() *MockMempoolMockRecorder
- func (m *MockMempool) EnableAdding()
- func (m *MockMempool) Get(arg0 ids.ID) *txs.Tx
- func (m *MockMempool) GetDropReason(arg0 ids.ID) error
- func (m *MockMempool) Has(arg0 ids.ID) bool
- func (m *MockMempool) HasStakerTx() bool
- func (m *MockMempool) HasTxs() bool
- func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error)
- func (m *MockMempool) PeekStakerTx() *txs.Tx
- func (m *MockMempool) PeekTxs(arg0 int) []*txs.Tx
- func (m *MockMempool) Remove(arg0 []*txs.Tx)
- type MockMempoolMockRecorder
- func (mr *MockMempoolMockRecorder) Add(arg0 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) DisableAdding() *gomock.Call
- func (mr *MockMempoolMockRecorder) EnableAdding() *gomock.Call
- func (mr *MockMempoolMockRecorder) Get(arg0 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) GetDropReason(arg0 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) Has(arg0 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) HasStakerTx() *gomock.Call
- func (mr *MockMempoolMockRecorder) HasTxs() *gomock.Call
- func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) PeekStakerTx() *gomock.Call
- func (mr *MockMempoolMockRecorder) PeekTxs(arg0 interface{}) *gomock.Call
- func (mr *MockMempoolMockRecorder) Remove(arg0 interface{}) *gomock.Call
Constants ¶
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 ¶
func DropExpiredStakerTxs ¶
Drops all txs.Staker transactions whose [StartTime] is before [minStartTime] from mempool. The dropped tx ids are returned.
TODO: Remove once [StartTime] field is ignored in staker txs
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 are 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 New ¶ added in v1.10.16
func New( 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) 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) GetDropReason ¶
func (m *MockMempool) GetDropReason(arg0 ids.ID) error
GetDropReason mocks base method.
func (*MockMempool) HasStakerTx ¶ added in v1.8.0
func (m *MockMempool) HasStakerTx() bool
HasStakerTx mocks base method.
func (*MockMempool) HasTxs ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (m *MockMempool) PeekStakerTx() *txs.Tx
PeekStakerTx mocks base method.
func (*MockMempool) PeekTxs ¶ added in v1.8.0
func (m *MockMempool) PeekTxs(arg0 int) []*txs.Tx
PeekTxs mocks base method.
func (*MockMempool) Remove ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (mr *MockMempoolMockRecorder) HasStakerTx() *gomock.Call
HasStakerTx indicates an expected call of HasStakerTx.
func (*MockMempoolMockRecorder) HasTxs ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (mr *MockMempoolMockRecorder) PeekStakerTx() *gomock.Call
PeekStakerTx indicates an expected call of PeekStakerTx.
func (*MockMempoolMockRecorder) PeekTxs ¶ added in v1.8.0
func (mr *MockMempoolMockRecorder) PeekTxs(arg0 interface{}) *gomock.Call
PeekTxs indicates an expected call of PeekTxs.
func (*MockMempoolMockRecorder) Remove ¶ added in v1.8.0
func (mr *MockMempoolMockRecorder) Remove(arg0 interface{}) *gomock.Call
Remove indicates an expected call of Remove.