| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke
Description
Smoke tests for the object diffusion protocol. This uses a trivial object pool and checks that a few objects can indeed be transferred from the outbound to the inbound peer.
Synopsis
- tests ∷ TestTree
- class WithId a idTy | a → idTy where
- getId ∷ a → idTy
- newtype ListWithUniqueIds a idTy = ListWithUniqueIds [a]
- data ProtocolConstants
- mockSystemTime ∷ ∀ (m ∷ Type → Type). Applicative m ⇒ SystemTime m
- prop_smoke_object_diffusion ∷ (Eq object, Show object, Ord objectId, Typeable objectId, Typeable object, NoThunks objectId, Show objectId, NoThunks object) ⇒ ProtocolConstants → [object] → (∀ (m ∷ Type → Type). IOLike m ⇒ ObjectDiffusionOutbound objectId object m () → Channel m (AnyMessage (ObjectDiffusion objectId object)) → Tracer m String → m ()) → (∀ (m ∷ Type → Type). IOLike m ⇒ ObjectDiffusionInboundPipelined objectId object m () → Channel m (AnyMessage (ObjectDiffusion objectId object)) → Tracer m String → m ()) → (∀ (m ∷ Type → Type). IOLike m ⇒ m (ObjectPoolReader objectId object ticketNo m, ObjectPoolWriter objectId object m, m [object])) → Property
- genSmokeObjectId ∷ Gen SmokeObjectId
- genSmokeObject ∷ Gen SmokeObject
- genListWithUniqueIds ∷ (Ord idTy, WithId a idTy) ⇒ Gen a → Gen (ListWithUniqueIds a idTy)
- genProtocolConstants ∷ Gen ProtocolConstants
- genRelativeTime ∷ Gen RelativeTime
- genWithArrivalTime ∷ Gen a → Gen (WithArrivalTime a)
- genPointTestBlock ∷ Gen (Point TestBlock)
Documentation
class WithId a idTy | a → idTy where Source #
Instances
| WithId (PerasCert blk) PerasRoundNo Source # | |
Defined in Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke Methods getId ∷ PerasCert blk → PerasRoundNo Source # | |
| WithId (WithArrivalTime (ValidatedPerasCert blk)) PerasRoundNo Source # | |
Defined in Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke Methods getId ∷ WithArrivalTime (ValidatedPerasCert blk) → PerasRoundNo Source # | |
| WithId (PerasVote blk) (PerasVoteId blk) Source # | |
Defined in Test.Consensus.MiniProtocol.ObjectDiffusion.PerasVote.Smoke Methods getId ∷ PerasVote blk → PerasVoteId blk Source # | |
| WithId (WithArrivalTime (ValidatedPerasVote blk)) (PerasVoteId blk) Source # | |
Defined in Test.Consensus.MiniProtocol.ObjectDiffusion.PerasVote.Smoke Methods getId ∷ WithArrivalTime (ValidatedPerasVote blk) → PerasVoteId blk Source # | |
newtype ListWithUniqueIds a idTy Source #
Constructors
| ListWithUniqueIds [a] |
Instances
data ProtocolConstants Source #
Instances
| Show ProtocolConstants Source # | |
Defined in Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke Methods showsPrec ∷ Int → ProtocolConstants → ShowS # show ∷ ProtocolConstants → String # showList ∷ [ProtocolConstants] → ShowS # | |
mockSystemTime ∷ ∀ (m ∷ Type → Type). Applicative m ⇒ SystemTime m Source #
A static SystemTime returning a constant time. The canonical mock
system time lives in mockSystemTime, but it
is a field of LogicalClock which requires a ResourceRegistry and
a background tick thread — too heavyweight for simple property tests
that don't need time progression.
prop_smoke_object_diffusion ∷ (Eq object, Show object, Ord objectId, Typeable objectId, Typeable object, NoThunks objectId, Show objectId, NoThunks object) ⇒ ProtocolConstants → [object] → (∀ (m ∷ Type → Type). IOLike m ⇒ ObjectDiffusionOutbound objectId object m () → Channel m (AnyMessage (ObjectDiffusion objectId object)) → Tracer m String → m ()) → (∀ (m ∷ Type → Type). IOLike m ⇒ ObjectDiffusionInboundPipelined objectId object m () → Channel m (AnyMessage (ObjectDiffusion objectId object)) → Tracer m String → m ()) → (∀ (m ∷ Type → Type). IOLike m ⇒ m (ObjectPoolReader objectId object ticketNo m, ObjectPoolWriter objectId object m, m [object])) → Property Source #
genSmokeObjectId ∷ Gen SmokeObjectId Source #
genSmokeObject ∷ Gen SmokeObject Source #
genListWithUniqueIds ∷ (Ord idTy, WithId a idTy) ⇒ Gen a → Gen (ListWithUniqueIds a idTy) Source #
genWithArrivalTime ∷ Gen a → Gen (WithArrivalTime a) Source #
genPointTestBlock ∷ Gen (Point TestBlock) Source #