tests
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.NodeSpec

Synopsis

Documentation

spec :: Spec Source #

primeWith :: Monad m => [Input tx] -> HydraNode tx m -> m (HydraNode tx m) Source #

Add given list of inputs to the InputQueue. This is returning the node to allow for chaining with runToCompletion.

notConnect :: MonadThrow m => DraftHydraNode tx m -> m (HydraNode tx m) Source #

Convert a DraftHydraNode to a HydraNode by providing mock implementations.

mockServer :: Monad m => Server tx m Source #

mockNetwork :: Monad m => Network m (Message tx) Source #

mockChain :: MonadThrow m => Chain tx m Source #

mockSink :: Monad m => EventSink a m Source #

mockEventStore :: Monad m => [a] -> EventStore a m Source #

mockSource :: Monad m => [a] -> EventSource a m Source #

createRecordingSink :: IO (EventSink a IO, IO [a]) Source #

createMockEventStore :: MonadLabelledSTM m => m (EventStore a m) Source #

inputsToOpenHead :: [Input SimpleTx] Source #

observationInput :: OnChainTx SimpleTx -> Input SimpleTx Source #

runToCompletion :: IsChainState tx => HydraNode tx IO -> IO () Source #

testHydraNode :: (MonadDelay m, MonadAsync m, MonadLabelledSTM m, MonadThrow m, MonadUnliftIO m) => Tracer m (HydraNodeLog SimpleTx) -> SigningKey HydraKey -> [Party] -> ContestationPeriod -> [Input SimpleTx] -> m (HydraNode SimpleTx m) Source #

Creates a full HydraNode with given parameters and primed Inputs. Note that this node is notConnected to any components.

testTTL :: TTL Source #

A lot shorter than the real world ttl which requires to be long to overcome some longer chain observation delays, but would just make tests longer.

recordNetwork :: HydraNode tx IO -> IO (HydraNode tx IO, IO [Message tx]) Source #

recordServerOutputs :: IsChainState tx => HydraNode tx IO -> IO (HydraNode tx IO, IO [Either (ServerOutput tx) (ClientMessage tx)]) Source #

messageRecorder :: IO (msg -> IO (), IO [msg]) Source #

throwExceptionOnPostTx :: IsChainState tx => PostTxError tx -> HydraNode tx IO -> IO (HydraNode tx IO) Source #