Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- genTimeHandleWithSlotInsideHorizon :: Gen (TimeHandle, SlotNo)
- genTimeHandleWithSlotPastHorizon :: Gen (TimeHandle, SlotNo)
- spec :: Spec
- recordEventsHandler :: ChainContext -> ChainStateAt -> GetTimeHandle IO -> IO (ChainSyncHandler IO, IO [ChainEvent Tx])
- data TestBlock = TestBlock BlockHeader [Tx]
- withCounterExample :: [TestBlock] -> TVar IO ChainStateAt -> IO a -> PropertyM IO a
- genBlockAt :: SlotNo -> [Tx] -> Gen TestBlock
- genRollbackPoint :: [TestBlock] -> Gen ChainPoint
- genRollbackBlocks :: [TestBlock] -> Gen (ChainPoint, [TestBlock])
- genSequenceOfObservableBlocks :: Gen (ChainContext, ChainStateAt, [TestBlock])
- showRollbackInfo :: (Word, ChainPoint) -> String
Documentation
genTimeHandleWithSlotInsideHorizon :: Gen (TimeHandle, SlotNo) Source #
genTimeHandleWithSlotPastHorizon :: Gen (TimeHandle, SlotNo) Source #
recordEventsHandler :: ChainContext -> ChainStateAt -> GetTimeHandle IO -> IO (ChainSyncHandler IO, IO [ChainEvent Tx]) Source #
Create a chain sync handler which records events as they are called back.
A block used for testing. This is a simpler version of the cardano-api
Block
and can be de-/constructed easily.
TestBlock BlockHeader [Tx] |
genBlockAt :: SlotNo -> [Tx] -> Gen TestBlock Source #
Thin wrapper which generates a TestBlock
at some specific slot.
genRollbackPoint :: [TestBlock] -> Gen ChainPoint Source #
Pick a block point in a list of blocks.
genRollbackBlocks :: [TestBlock] -> Gen (ChainPoint, [TestBlock]) Source #
Pick a rollback point from a list of blocks and also yield the tail of blocks to be replayed.
genSequenceOfObservableBlocks :: Gen (ChainContext, ChainStateAt, [TestBlock]) Source #
Generate a non-sparse sequence of blocks each containing an observable transaction, starting from the returned on-chain head state.
Note that this does not generate the entire spectrum of observable transactions in Hydra, but only init and commits, which is already sufficient to observe at least one state transition and different levels of rollback.
showRollbackInfo :: (Word, ChainPoint) -> String Source #