| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- runRecordedFill :: Message msg => [FieldPath] -> FieldFill (Writer [Text]) msg -> (msg, [Text])
- readRecordedComponent :: StoredBlock -> BlockComponent (CardanoBlock StandardCrypto) a -> Writer [Text] a
- logRecorded :: IORef [Text] -> Writer [Text] a -> IO a
- recorded :: Text -> a -> Writer [Text] a
- session :: Writer [Text] a -> Writer [Text] a
- data StoredBlock = StoredBlock {}
- toStoredBlock :: (ByteString, BlockInMode) -> StoredBlock
- realTip :: ChainPoint
- realFields :: [UtxoFields]
Documentation
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.
Run recorded actions in IO, appending what they record to the log.
An action that records its name when it runs.
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.
Constructors
| StoredBlock | |
Fields | |
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.