Documentation
¶
Overview ¶
Package mempool is a generated GoMock package.
Index ¶
- Constants
- Variables
- func New[T Tx](metrics Metrics) *mempool[T]
- type Mempool
- type Metrics
- type MockMempool
- func (m *MockMempool) Add(arg0 *txs.Tx) error
- func (m *MockMempool) DropExpiredStakerTxs(arg0 time.Time) []ids.ID
- func (m *MockMempool) EXPECT() *MockMempoolMockRecorder
- func (m *MockMempool) Get(arg0 ids.ID) (*txs.Tx, bool)
- func (m *MockMempool) GetDropReason(arg0 ids.ID) error
- func (m *MockMempool) Has(arg0 ids.ID) bool
- func (m *MockMempool) HasTxs() bool
- func (m *MockMempool) Iterate(arg0 func(*txs.Tx) bool)
- func (m *MockMempool) Len() int
- func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error)
- func (m *MockMempool) Peek() (*txs.Tx, bool)
- func (m *MockMempool) PeekTxs(arg0 int) []*txs.Tx
- func (m *MockMempool) Remove(arg0 ...*txs.Tx)
- func (m *MockMempool) RequestBuildBlock(arg0 bool)
- type MockMempoolMockRecorder
- func (mr *MockMempoolMockRecorder) Add(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) DropExpiredStakerTxs(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) Get(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) GetDropReason(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) Has(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) HasTxs() *gomock.Call
- func (mr *MockMempoolMockRecorder) Iterate(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) Len() *gomock.Call
- func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) Peek() *gomock.Call
- func (mr *MockMempoolMockRecorder) PeekTxs(arg0 any) *gomock.Call
- func (mr *MockMempoolMockRecorder) Remove(arg0 ...any) *gomock.Call
- func (mr *MockMempoolMockRecorder) RequestBuildBlock(arg0 any) *gomock.Call
- type Tx
Constants ¶
const ( // MaxTxSize is the maximum number of bytes a transaction can use to be // allowed into the mempool. Increased from 64 KiB to 2 MiB to support // large genesis configurations (e.g., ZOO L2 genesis is ~613 KiB). MaxTxSize = 2 * constants.MiB )
Variables ¶
Functions ¶
Types ¶
type Mempool ¶
type Mempool[T Tx] interface { Add(tx T) error Get(txID ids.ID) (T, bool) // Remove [txs] and any conflicts of [txs] from the mempool. Remove(txs ...T) // Peek returns the oldest tx in the mempool. Peek() (tx T, exists bool) // Iterate iterates over the txs until f returns false Iterate(f func(tx T) bool) // 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 // Len returns the number of txs in the mempool. Len() int // WaitForEvent waits until there is at least one tx in the mempool. WaitForEvent(ctx context.Context) (engine.Message, error) }
type Metrics ¶
type Metrics interface {
Update(numTxs, bytesAvailable int)
}
func NewMetrics ¶
func NewMetrics(namespace string, registerer metric.Registerer) (Metrics, error)
NewMetrics creates a new Metrics instance
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) DropExpiredStakerTxs ¶
func (m *MockMempool) DropExpiredStakerTxs(arg0 time.Time) []ids.ID
DropExpiredStakerTxs 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) GetDropReason ¶
func (m *MockMempool) GetDropReason(arg0 ids.ID) error
GetDropReason mocks base method.
func (*MockMempool) Iterate ¶
func (m *MockMempool) Iterate(arg0 func(*txs.Tx) bool)
Iterate mocks base method.
func (*MockMempool) MarkDropped ¶
func (m *MockMempool) MarkDropped(arg0 ids.ID, arg1 error)
MarkDropped 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.
func (*MockMempool) RequestBuildBlock ¶
func (m *MockMempool) RequestBuildBlock(arg0 bool)
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 any) *gomock.Call
Add indicates an expected call of Add.
func (*MockMempoolMockRecorder) DropExpiredStakerTxs ¶
func (mr *MockMempoolMockRecorder) DropExpiredStakerTxs(arg0 any) *gomock.Call
DropExpiredStakerTxs indicates an expected call of DropExpiredStakerTxs.
func (*MockMempoolMockRecorder) Get ¶
func (mr *MockMempoolMockRecorder) Get(arg0 any) *gomock.Call
Get indicates an expected call of Get.
func (*MockMempoolMockRecorder) GetDropReason ¶
func (mr *MockMempoolMockRecorder) GetDropReason(arg0 any) *gomock.Call
GetDropReason indicates an expected call of GetDropReason.
func (*MockMempoolMockRecorder) Has ¶
func (mr *MockMempoolMockRecorder) Has(arg0 any) *gomock.Call
Has indicates an expected call of Has.
func (*MockMempoolMockRecorder) HasTxs ¶
func (mr *MockMempoolMockRecorder) HasTxs() *gomock.Call
HasTxs indicates an expected call of HasTxs.
func (*MockMempoolMockRecorder) Iterate ¶
func (mr *MockMempoolMockRecorder) Iterate(arg0 any) *gomock.Call
Iterate indicates an expected call of Iterate.
func (*MockMempoolMockRecorder) Len ¶
func (mr *MockMempoolMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockMempoolMockRecorder) MarkDropped ¶
func (mr *MockMempoolMockRecorder) MarkDropped(arg0, arg1 any) *gomock.Call
MarkDropped indicates an expected call of MarkDropped.
func (*MockMempoolMockRecorder) Peek ¶
func (mr *MockMempoolMockRecorder) Peek() *gomock.Call
Peek indicates an expected call of Peek.
func (*MockMempoolMockRecorder) PeekTxs ¶
func (mr *MockMempoolMockRecorder) PeekTxs(arg0 any) *gomock.Call
PeekTxs indicates an expected call of PeekTxs.
func (*MockMempoolMockRecorder) Remove ¶
func (mr *MockMempoolMockRecorder) Remove(arg0 ...any) *gomock.Call
Remove indicates an expected call of Remove.
func (*MockMempoolMockRecorder) RequestBuildBlock ¶
func (mr *MockMempoolMockRecorder) RequestBuildBlock(arg0 any) *gomock.Call
RequestBuildBlock indicates an expected call of RequestBuildBlock.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mempoolmock is a generated GoMock package.
|
Package mempoolmock is a generated GoMock package. |