github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/bft/mempool/mock/mock.go (about) 1 package mock 2 3 import ( 4 abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types" 5 mempl "github.com/gnolang/gno/tm2/pkg/bft/mempool" 6 "github.com/gnolang/gno/tm2/pkg/bft/types" 7 "github.com/gnolang/gno/tm2/pkg/clist" 8 ) 9 10 // Mempool is an empty implementation of a Mempool, useful for testing. 11 type Mempool struct{} 12 13 var _ mempl.Mempool = Mempool{} 14 15 func (Mempool) Lock() {} 16 func (Mempool) Unlock() {} 17 func (Mempool) Size() int { return 0 } 18 func (Mempool) CheckTx(_ types.Tx, _ func(abci.Response)) error { 19 return nil 20 } 21 22 func (Mempool) CheckTxWithInfo(_ types.Tx, _ func(abci.Response), 23 _ mempl.TxInfo, 24 ) error { 25 return nil 26 } 27 func (Mempool) ReapMaxBytesMaxGas(_, _ int64) types.Txs { return types.Txs{} } 28 func (Mempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} } 29 func (Mempool) Update( 30 _ int64, 31 _ types.Txs, 32 _ []abci.ResponseDeliverTx, 33 _ mempl.PreCheckFunc, 34 _ int64, 35 ) error { 36 return nil 37 } 38 func (Mempool) Flush() {} 39 func (Mempool) FlushAppConn() error { return nil } 40 func (Mempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } 41 func (Mempool) EnableTxsAvailable() {} 42 func (Mempool) MaxTxBytes() int64 { return 0 } 43 func (Mempool) TxsBytes() int64 { return 0 } 44 45 func (Mempool) TxsFront() *clist.CElement { return nil } 46 func (Mempool) TxsWaitChan() <-chan struct{} { return nil } 47 48 func (Mempool) InitWAL() {} 49 func (Mempool) CloseWAL() {}