feat: no-op mempool (#14297)

This commit is contained in:
Aleksandr Bezobchuk
2022-12-14 20:44:05 +00:00
committed by GitHub
parent 05a6da32e2
commit a4d1ede3e9
2 changed files with 67 additions and 9 deletions
+22
View File
@@ -0,0 +1,22 @@
package mempool
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
)
var _ Mempool = (*NoOpMempool)(nil)
// NoOpMempool defines a no-op mempool. Transactions are completely discarded and
// ignored when BaseApp interacts with the mempool.
//
// Note: When this mempool is used, it assumed that an application will rely
// on Tendermint's transaction ordering defined in `RequestPrepareProposal`, which
// is FIFO-ordered by default.
type NoOpMempool struct{}
func (NoOpMempool) Insert(context.Context, sdk.Tx) error { return nil }
func (NoOpMempool) Select(context.Context, [][]byte) Iterator { return nil }
func (NoOpMempool) CountTx() int { return 0 }
func (NoOpMempool) Remove(sdk.Tx) error { return nil }