hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Events.SQLiteBasedSpec

Description

Tests for the EventSource and EventSink implementation in SQLiteBased.

Synopsis

Documentation

spec :: Spec Source #

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 #

withEventSourceAndSink :: (EventSource (StateEvent SimpleTx) IO -> EventSink (StateEvent SimpleTx) IO -> IO b) -> IO b Source #