ouroboros-network:ouroboros-network-tests-lib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.TxSubmission.Types

Synopsis

Documentation

data Tx txid Source #

Constructors

Tx 

Fields

  • getTxId :: !txid
     
  • getTxSize :: !SizeInBytes
     
  • getTxAdvSize :: !SizeInBytes
     
  • getTxValid :: !Bool

    If false this means that when this tx will be submitted to a remote mempool it will not be valid. The outbound mempool might contain invalid tx's in this sense.

  • getTxParent :: !(Maybe txid)

    Optional parent dependency: this tx may only be accepted into a mempool once its parent is already present (either from an earlier batch or earlier in the same batch). Nothing means no dependency. Used by chain-aware tests to model transaction chains.

Instances

Instances details
ShowProxy txid => ShowProxy (Tx txid :: Type) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

showProxy :: Proxy (Tx txid) -> String

Arbitrary txid => Arbitrary (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

arbitrary :: Gen (Tx txid) #

shrink :: Tx txid -> [Tx txid] #

NFData txid => NFData (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

rnf :: Tx txid -> () #

Generic (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Associated Types

type Rep (Tx txid) 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

type Rep (Tx txid) = D1 ('MetaData "Tx" "Test.Ouroboros.Network.TxSubmission.Types" "ouroboros-network-1.1.0.0-inplace-ouroboros-network-tests-lib" 'False) (C1 ('MetaCons "Tx" 'PrefixI 'True) ((S1 ('MetaSel ('Just "getTxId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 txid) :*: S1 ('MetaSel ('Just "getTxSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SizeInBytes)) :*: (S1 ('MetaSel ('Just "getTxAdvSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SizeInBytes) :*: (S1 ('MetaSel ('Just "getTxValid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "getTxParent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe txid))))))

Methods

from :: Tx txid -> Rep (Tx txid) x #

to :: Rep (Tx txid) x -> Tx txid #

Show txid => Show (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

showsPrec :: Int -> Tx txid -> ShowS #

show :: Tx txid -> String #

showList :: [Tx txid] -> ShowS #

Eq txid => Eq (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

(==) :: Tx txid -> Tx txid -> Bool #

(/=) :: Tx txid -> Tx txid -> Bool #

Ord txid => Ord (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

compare :: Tx txid -> Tx txid -> Ordering #

(<) :: Tx txid -> Tx txid -> Bool #

(<=) :: Tx txid -> Tx txid -> Bool #

(>) :: Tx txid -> Tx txid -> Bool #

(>=) :: Tx txid -> Tx txid -> Bool #

max :: Tx txid -> Tx txid -> Tx txid #

min :: Tx txid -> Tx txid -> Tx txid #

NoThunks txid => NoThunks (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

Methods

noThunks :: Context -> Tx txid -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> Tx txid -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (Tx txid) -> String #

type Rep (Tx txid) Source # 
Instance details

Defined in Test.Ouroboros.Network.TxSubmission.Types

type Rep (Tx txid) = D1 ('MetaData "Tx" "Test.Ouroboros.Network.TxSubmission.Types" "ouroboros-network-1.1.0.0-inplace-ouroboros-network-tests-lib" 'False) (C1 ('MetaCons "Tx" 'PrefixI 'True) ((S1 ('MetaSel ('Just "getTxId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 txid) :*: S1 ('MetaSel ('Just "getTxSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SizeInBytes)) :*: (S1 ('MetaSel ('Just "getTxAdvSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SizeInBytes) :*: (S1 ('MetaSel ('Just "getTxValid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "getTxParent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe txid))))))

type TxId = Int Source #

data Mempool (m :: Type -> Type) txid tx #

A simple in-memory mempool implementation.

emptyMempool :: MonadSTM m => m (Mempool m txid (Tx txid)) Source #

newMempool :: (MonadSTM m, Ord txid) => [Tx txid] -> m (Mempool m txid (Tx txid)) Source #

readMempool :: MonadSTM m => Mempool m txid (Tx txid) -> m [Tx txid] Source #

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 #

txSubmissionCodec2 :: forall (m :: Type -> Type). MonadST m => Codec (TxSubmission2 Int (Tx Int)) DeserialiseFailure m ByteString Source #

verboseTracer :: forall a (m :: Type -> Type). (MonadAsync m, MonadDelay m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a Source #