| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.TxSubmission.Mempool.Simple
Description
The module should be imported qualified.
Synopsis
- newtype Mempool (m :: Type -> Type) txid tx = Mempool (StrictTVar m (MempoolSeq txid tx))
- data MempoolSeq txid tx = MempoolSeq {
- mempoolSet :: !(Set txid)
- mempoolSeq :: !(Seq (WithIndex tx))
- nextIdx :: !Integer
- data WithIndex tx = WithIndex {}
- empty :: MonadSTM m => m (Mempool m txid tx)
- new :: (MonadSTM m, Ord txid) => (tx -> txid) -> [tx] -> m (Mempool m txid tx)
- read :: MonadSTM m => Mempool m txid tx -> m [tx]
- getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Ord txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m txid tx -> TxSubmissionMempoolReader txid tx Integer m
- data TxSubmissionMempoolReader txid tx idx (m :: Type -> Type) = TxSubmissionMempoolReader {
- mempoolGetSnapshot :: STM m (MempoolSnapshot txid tx idx)
- mempoolZeroIdx :: idx
- getWriter :: forall tx txid failure m. (MonadSTM m, MonadTime m, Ord txid) => failure -> (tx -> txid) -> (UTCTime -> [tx] -> STM m [Either (txid, failure) tx]) -> ([(txid, failure)] -> m ()) -> Mempool m txid tx -> TxSubmissionMempoolWriter txid tx Integer m failure
- data TxSubmissionMempoolWriter txid tx idx (m :: Type -> Type) err = TxSubmissionMempoolWriter {
- txId :: tx -> txid
- mempoolAddTxs :: [tx] -> m ([txid], [(txid, err)])
Documentation
newtype Mempool (m :: Type -> Type) txid tx Source #
A simple in-memory mempool implementation.
Constructors
| Mempool (StrictTVar m (MempoolSeq txid tx)) |
data MempoolSeq txid tx Source #
Constructors
| MempoolSeq | |
Fields
| |
getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Ord txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m txid tx -> TxSubmissionMempoolReader txid tx Integer m Source #
data TxSubmissionMempoolReader txid tx idx (m :: Type -> Type) Source #
The consensus layer functionality that the inbound and outbound side of the tx submission logic requires.
This is provided to the tx submission logic by the consensus layer.
Constructors
| TxSubmissionMempoolReader | |
Fields
| |
Arguments
| :: forall tx txid failure m. (MonadSTM m, MonadTime m, Ord txid) | |
| => failure | duplicate tx error |
| -> (tx -> txid) | get transaction hash |
| -> (UTCTime -> [tx] -> STM m [Either (txid, failure) tx]) | validate a tx in an |
| -> ([(txid, failure)] -> m ()) | handle invalid txs, e.g. logging, throwing exceptions, etc |
| -> Mempool m txid tx | mempool |
| -> TxSubmissionMempoolWriter txid tx Integer m failure |
A simple mempool writer.
data TxSubmissionMempoolWriter txid tx idx (m :: Type -> Type) err Source #
The consensus layer functionality that the inbound side of the tx submission logic requires.
This is provided to the tx submission logic by the consensus layer.
Constructors
| TxSubmissionMempoolWriter | |
Fields
| |