| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Events.SQLiteBasedSpec
Description
Tests for the EventSource and EventSink implementation in SQLiteBased.
Synopsis
- spec :: Spec
- migratesV1JsonToV2CBOR :: Int -> IO ()
- genContinuousEvents :: Gen [StateEvent SimpleTx]
- mkContinuousEvents :: [StateChanged tx] -> [UTCTime] -> [StateEvent tx]
- withEventSourceAndSink :: (EventSource (StateEvent SimpleTx) IO -> EventSink (StateEvent SimpleTx) IO -> IO b) -> IO b
Documentation
migratesV1JsonToV2CBOR :: Int -> IO () Source #
Create a v1 database with n JSON-encoded 'StateEvent Tx' rows (as
written by hydra-node versions before the CBOR switch), open it (triggering
the migration) and assert nothing is lost: the events load back equal, and
each migrated row's raw CBOR decodes to exactly the event that was inserted
as JSON. Uses the production event type (Tx, the one real hydra.db files
store) rather than SimpleTx.
genContinuousEvents :: Gen [StateEvent SimpleTx] Source #
mkContinuousEvents :: [StateChanged tx] -> [UTCTime] -> [StateEvent tx] Source #