cardano-sl-0.4.3: Cardano SL main implementation

Safe HaskellNone
LanguageHaskell2010

Pos.DB.Block

Contents

Description

Interface to Blocks DB.

Synopsis

Documentation

getBlock :: (SscHelpersClass ssc, MonadDB m) => HeaderHash -> m (Maybe (Block ssc)) Source #

Get block with given hash from Block DB.

getBlockHeader :: (SscHelpersClass ssc, MonadDB m) => HeaderHash -> m (Maybe (BlockHeader ssc)) Source #

Returns header of block that was requested from Block DB.

getUndo :: MonadDB m => HeaderHash -> m (Maybe Undo) Source #

Get undo data for block with given hash from Block DB.

getBlockWithUndo :: (SscHelpersClass ssc, MonadDB m) => HeaderHash -> m (Maybe (Block ssc, Undo)) Source #

Retrieves block and undo together.

putBlock :: (SscHelpersClass ssc, MonadDB m) => Undo -> Block ssc -> m () Source #

Put given block, its metadata and Undo data into Block DB.

prepareBlockDB :: forall ssc m. (SscHelpersClass ssc, MonadDB m) => GenesisBlock ssc -> m () Source #

Load data

loadBlundsWhile :: (SscHelpersClass ssc, MonadDB m) => (Block ssc -> Bool) -> HeaderHash -> m (NewestFirst [] (Blund ssc)) Source #

Load blunds starting from block with header hash equal to given hash and while predicate is true.

loadBlundsByDepth :: (SscHelpersClass ssc, MonadDB m) => Word -> HeaderHash -> m (NewestFirst [] (Blund ssc)) Source #

Load blunds which have depth less than given.

loadBlocksWhile :: (SscHelpersClass ssc, MonadDB m) => (Block ssc -> Bool) -> HeaderHash -> m (NewestFirst [] (Block ssc)) Source #

Load blocks starting from block with header hash equal to given hash and while predicate is true.

loadHeadersWhile :: (SscHelpersClass ssc, MonadDB m) => (BlockHeader ssc -> Bool) -> HeaderHash -> m (NewestFirst [] (BlockHeader ssc)) Source #

Load headers starting from block with header hash equal to given hash and while predicate is true.

loadHeadersByDepth :: (SscHelpersClass ssc, MonadDB m) => Word -> HeaderHash -> m (NewestFirst [] (BlockHeader ssc)) Source #

Load headers which have depth less than given.

loadHeadersByDepthWhile :: (SscHelpersClass ssc, MonadDB m) => (BlockHeader ssc -> Bool) -> Word -> HeaderHash -> m (NewestFirst [] (BlockHeader ssc)) Source #

Load headers which have depth less than given and match some criterion.