cardano-rpc:testlib
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Rpc.RecordedQuery

Description

Actions that record their name when they run, and the values they return, for testing which queries and block reads a field fill runs.

Synopsis

Documentation

runRecordedFill Source #

Arguments

:: Message msg 
=> [FieldPath]

Field mask paths, rooted at the response

-> FieldFill (Writer [Text]) msg

Fills the response from recorded actions

-> (msg, [Text]) 

Run a fill for the mask paths, recording the session and each query it runs.

readRecordedComponent Source #

Arguments

:: StoredBlock

The block to read from

-> BlockComponent (CardanoBlock StandardCrypto) a

The components to read

-> Writer [Text] a 

Read block components from a stored block as ChainDB would, recording each component read.

logRecorded Source #

Arguments

:: IORef [Text]

The log

-> Writer [Text] a

The recorded actions

-> IO a 

Run recorded actions in IO, appending what they record to the log.

recorded Source #

Arguments

:: Text

The name to record

-> a

The result of the action

-> Writer [Text] a 

An action that records its name when it runs.

session Source #

Arguments

:: Writer [Text] a

The actions to run in the session

-> Writer [Text] a 

A runner that records each session it opens.

data StoredBlock Source #

A block as ChainDB stores it: its point, which ChainDB keeps in its index, its raw bytes and the parsed block. The fields are lazy, so a test can leave out a part that must not be read.

toStoredBlock Source #

Arguments

:: (ByteString, BlockInMode)

The raw block and the same block parsed

-> StoredBlock 

Store a raw block and its parsed form at the point its header names.

realTip :: ChainPoint Source #

The chain tip that the recorded tip queries return.

realFields :: [UtxoFields] Source #

The UTxO entries that the recorded UTxO queries return.