github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/test/mock/mempool.go (about)

     1  package mock
     2  
     3  import (
     4  	"github.com/bytom/bytom/protocol"
     5  	"github.com/bytom/bytom/protocol/bc/types"
     6  )
     7  
     8  type Mempool struct {
     9  	txs []*protocol.TxDesc
    10  }
    11  
    12  func newMempool() *Mempool {
    13  	return &Mempool{
    14  		txs: []*protocol.TxDesc{},
    15  	}
    16  }
    17  
    18  func (m *Mempool) AddTx(tx *types.Tx) {
    19  	m.txs = append(m.txs, &protocol.TxDesc{Tx: tx})
    20  }
    21  
    22  func (m *Mempool) GetTransactions() []*protocol.TxDesc {
    23  	return m.txs
    24  }
    25  
    26  func (m *Mempool) IsDust(tx *types.Tx) bool {
    27  	return false
    28  }