| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Ouroboros.Network.TxSubmission.Types
Contents
Synopsis
- data Tx txid = Tx {
- getTxId :: !txid
- getTxSize :: !SizeInBytes
- getTxAdvSize :: !SizeInBytes
- getTxValid :: !Bool
- getTxParent :: !(Maybe txid)
- type TxId = Int
- data Mempool (m :: Type -> Type) txid tx
- emptyMempool :: MonadSTM m => m (Mempool m txid (Tx txid))
- newMempool :: (MonadSTM m, Ord txid) => [Tx txid] -> m (Mempool m txid (Tx txid))
- readMempool :: MonadSTM m => Mempool m txid (Tx txid) -> m [Tx txid]
- getMempoolReader :: forall txid (m :: Type -> Type). (MonadSTM m, Ord txid, Show txid) => Mempool m txid (Tx txid) -> TxSubmissionMempoolReader txid (Tx txid) Integer m
- getMempoolWriter :: forall txid (m :: Type -> Type). (MonadSTM m, MonadTime m, MonadThrow m, Ord txid, Eq txid, Typeable txid, Show txid) => TVar m [txid] -> Mempool m txid (Tx txid) -> TxSubmissionMempoolWriter txid (Tx txid) Integer m InvalidTx
- data InvalidTx
- maxTxSize :: SizeInBytes
- newtype LargeNonEmptyList a = LargeNonEmpty {
- getLargeNonEmpty :: [a]
- data SimResults a
- = SimReturn a [String]
- | SimException SomeException [String]
- | SimDeadLock [String]
- data WithThreadAndTime (m :: Type -> Type) a = WithThreadAndTime {
- wtatOccuredAt :: !Time
- wtatWithinThread :: !(ThreadId m)
- wtatEvent :: !a
- txSubmissionCodec2 :: forall (m :: Type -> Type). MonadST m => Codec (TxSubmission2 Int (Tx Int)) DeserialiseFailure m ByteString
- evaluateTrace :: SimTrace a -> IO (SimResults a)
- verboseTracer :: forall a (m :: Type -> Type). (MonadFork m, MonadDelay m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a
- data TxSubmissionConfig = TxSubmissionConfig {
- maxNumUnacknowledgedTxIds :: !NumTxIdsToAck
- maxNumTxIdsToRequest :: !NumTxIdsToReq
- newtype ArbTxSubmissionConfig = ArbTxSubmissionConfig TxSubmissionConfig
- newtype ArbTxOutboundVersion = ArbTxOutboundVersion TxOutboundVersion
- data ArbTxSubmissionConfigs = ArbTxSubmissionConfigs TxOutboundVersion TxSubmissionConfig TxSubmissionConfig
- data RequestTxIdsEvent
- data OutboundRequest
- = RequestTxIds Bool NumTxIdsToAck NumTxIdsToReq RequestTxIdsEvent Int
- | RequestTxs Int
- requestTxIdsEvents :: [OutboundRequest] -> [RequestTxIdsEvent]
- traceOutboundRequests :: forall txid tx (m :: Type -> Type) a. Monad m => Tracer m OutboundRequest -> NumTxIdsToAck -> TxSubmissionClient txid tx m a -> TxSubmissionClient txid tx m a
- unsafeMkTxDecisionPolicy :: HasCallStack => TxSubmissionConfig -> TxDecisionPolicy
Documentation
Constructors
| Tx | |
Fields
| |
Instances
getMempoolReader :: forall txid (m :: Type -> Type). (MonadSTM m, Ord txid, Show txid) => Mempool m txid (Tx txid) -> TxSubmissionMempoolReader txid (Tx txid) Integer m Source #
getMempoolWriter :: forall txid (m :: Type -> Type). (MonadSTM m, MonadTime m, MonadThrow m, Ord txid, Eq txid, Typeable txid, Show txid) => TVar m [txid] -> Mempool m txid (Tx txid) -> TxSubmissionMempoolWriter txid (Tx txid) Integer m InvalidTx Source #
Constructors
| InvalidTx | |
| DuplicateTx | |
| MissingParent |
newtype LargeNonEmptyList a Source #
Constructors
| LargeNonEmpty | |
Fields
| |
Instances
| Arbitrary a => Arbitrary (LargeNonEmptyList a) Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods arbitrary :: Gen (LargeNonEmptyList a) # shrink :: LargeNonEmptyList a -> [LargeNonEmptyList a] # | |
| Show a => Show (LargeNonEmptyList a) Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> LargeNonEmptyList a -> ShowS # show :: LargeNonEmptyList a -> String # showList :: [LargeNonEmptyList a] -> ShowS # | |
data SimResults a Source #
Constructors
| SimReturn a [String] | |
| SimException SomeException [String] | |
| SimDeadLock [String] |
data WithThreadAndTime (m :: Type -> Type) a #
Constructors
| WithThreadAndTime | |
Fields
| |
Instances
| (Show (ThreadId m), Show a) => Show (WithThreadAndTime m a) | |
Defined in Test.Ouroboros.Network.Utils Methods showsPrec :: Int -> WithThreadAndTime m a -> ShowS # show :: WithThreadAndTime m a -> String # showList :: [WithThreadAndTime m a] -> ShowS # | |
txSubmissionCodec2 :: forall (m :: Type -> Type). MonadST m => Codec (TxSubmission2 Int (Tx Int)) DeserialiseFailure m ByteString Source #
evaluateTrace :: SimTrace a -> IO (SimResults a) Source #
verboseTracer :: forall a (m :: Type -> Type). (MonadFork m, MonadDelay m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a Source #
data TxSubmissionConfig #
Shared options between the inbound and outbound side.
Constructors
| TxSubmissionConfig | |
Fields
| |
Instances
| NFData TxSubmissionConfig | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods rnf :: TxSubmissionConfig -> () # | |
| Show TxSubmissionConfig | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods showsPrec :: Int -> TxSubmissionConfig -> ShowS # show :: TxSubmissionConfig -> String # showList :: [TxSubmissionConfig] -> ShowS # | |
| Eq TxSubmissionConfig | |
Defined in Ouroboros.Network.TxSubmission.Inbound.V2.Policy Methods (==) :: TxSubmissionConfig -> TxSubmissionConfig -> Bool # (/=) :: TxSubmissionConfig -> TxSubmissionConfig -> Bool # | |
newtype ArbTxSubmissionConfig Source #
Constructors
| ArbTxSubmissionConfig TxSubmissionConfig |
Instances
| Arbitrary ArbTxSubmissionConfig Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods arbitrary :: Gen ArbTxSubmissionConfig # shrink :: ArbTxSubmissionConfig -> [ArbTxSubmissionConfig] # | |
| Show ArbTxSubmissionConfig Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> ArbTxSubmissionConfig -> ShowS # show :: ArbTxSubmissionConfig -> String # showList :: [ArbTxSubmissionConfig] -> ShowS # | |
newtype ArbTxOutboundVersion Source #
Constructors
| ArbTxOutboundVersion TxOutboundVersion |
Instances
| Arbitrary ArbTxOutboundVersion Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods | |
| Show ArbTxOutboundVersion Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> ArbTxOutboundVersion -> ShowS # show :: ArbTxOutboundVersion -> String # showList :: [ArbTxOutboundVersion] -> ShowS # | |
data ArbTxSubmissionConfigs Source #
A TxOutboundVersion and two configs, e.g. the inbound's and the
outbound's, or two nodes'. Under TxOutboundV_1 the window is a protocol
parameter, so both share the config. Under TxOutboundV_2 the second has
its own window, mostly not larger than the first's, so that the second
clamps the first's requests.
Constructors
| ArbTxSubmissionConfigs | |
Fields
| |
Instances
| Arbitrary ArbTxSubmissionConfigs Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods arbitrary :: Gen ArbTxSubmissionConfigs # shrink :: ArbTxSubmissionConfigs -> [ArbTxSubmissionConfigs] # | |
| Show ArbTxSubmissionConfigs Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> ArbTxSubmissionConfigs -> ShowS # show :: ArbTxSubmissionConfigs -> String # showList :: [ArbTxSubmissionConfigs] -> ShowS # | |
data RequestTxIdsEvent Source #
How the outbound handles a MsgRequestTxIds, given its own window.
Constructors
| NotClamped | the requested txids fit within the window |
| Clamped | the request is clamped to the room left in the window |
| ClampedToZero | the window is full: the request is clamped to no txids |
Instances
| Show RequestTxIdsEvent Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> RequestTxIdsEvent -> ShowS # show :: RequestTxIdsEvent -> String # showList :: [RequestTxIdsEvent] -> ShowS # | |
| Eq RequestTxIdsEvent Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods (==) :: RequestTxIdsEvent -> RequestTxIdsEvent -> Bool # (/=) :: RequestTxIdsEvent -> RequestTxIdsEvent -> Bool # | |
data OutboundRequest Source #
A request received by the outbound, traced by
traceOutboundRequests.
Constructors
| RequestTxIds Bool NumTxIdsToAck NumTxIdsToReq RequestTxIdsEvent Int | a |
| RequestTxs Int | a |
Instances
| Show OutboundRequest Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods showsPrec :: Int -> OutboundRequest -> ShowS # show :: OutboundRequest -> String # showList :: [OutboundRequest] -> ShowS # | |
| Eq OutboundRequest Source # | |
Defined in Test.Ouroboros.Network.TxSubmission.Types Methods (==) :: OutboundRequest -> OutboundRequest -> Bool # (/=) :: OutboundRequest -> OutboundRequest -> Bool # | |
traceOutboundRequests Source #
Arguments
| :: forall txid tx (m :: Type -> Type) a. Monad m | |
| => Tracer m OutboundRequest | |
| -> NumTxIdsToAck | the outbound's window |
| -> TxSubmissionClient txid tx m a | |
| -> TxSubmissionClient txid tx m a |
Wrap an outbound, tracing every request it receives. The number of unacknowledged txids is tracked from the acknowledged and requested numbers and the lengths of the replies, as the outbound does.
unsafeMkTxDecisionPolicy :: HasCallStack => TxSubmissionConfig -> TxDecisionPolicy Source #
mkTxDecisionPolicy for a config which a test knows to be sane.
Orphan instances
| HasRawTxId Int Source # | |||||
Associated Types
Methods getRawTxId :: Int -> RawTxId Int | |||||