storage-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Ouroboros.Storage.VolatileDB.Model

Description

In-memory model implementation of VolatileDB

Synopsis

Documentation

data DBModel blk Source #

Constructors

DBModel 

Fields

Instances

Instances details
Generic (DBModel blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

Associated Types

type Rep (DBModel blk) ∷ TypeType #

Methods

fromDBModel blk → Rep (DBModel blk) x #

toRep (DBModel blk) x → DBModel blk #

(Show blk, Show (CodecConfig blk)) ⇒ Show (DBModel blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

Methods

showsPrecIntDBModel blk → ShowS #

showDBModel blk → String #

showList ∷ [DBModel blk] → ShowS #

(ToExpr blk, ToExpr (CodecConfig blk)) ⇒ ToExpr (DBModel blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

Methods

toExprDBModel blk → Expr Source #

listToExpr ∷ [DBModel blk] → Expr Source #

type Rep (DBModel blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

type Rep (DBModel blk) = D1 ('MetaData "DBModel" "Test.Ouroboros.Storage.VolatileDB.Model" "ouroboros-consensus-0.21.0.0-inplace-storage-test" 'False) (C1 ('MetaCons "DBModel" 'PrefixI 'True) ((S1 ('MetaSel ('Just "blocksPerFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlocksPerFile) :*: S1 ('MetaSel ('Just "open") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "fileIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map FileId (BlocksInFile blk))) :*: S1 ('MetaSel ('Just "codecConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CodecConfig blk)))))

Basic API

garbageCollectModel ∷ ∀ blk. HasHeader blk ⇒ SlotNoDBModel blk → Either (VolatileDBError blk) (DBModel blk) Source #

putBlockModel ∷ ∀ blk. HasHeader blk ⇒ blk → DBModel blk → Either (VolatileDBError blk) (DBModel blk) Source #

Corruptions

Exported for testing purposes

newtype BlocksInFile blk Source #

The blocks in a file, in the same order as they would be written to the file in the real implementation.

Constructors

BlocksInFile 

Fields

Instances

Instances details
Generic (BlocksInFile blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

Associated Types

type Rep (BlocksInFile blk) ∷ TypeType #

Methods

fromBlocksInFile blk → Rep (BlocksInFile blk) x #

toRep (BlocksInFile blk) x → BlocksInFile blk #

Show blk ⇒ Show (BlocksInFile blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

Methods

showsPrecIntBlocksInFile blk → ShowS #

showBlocksInFile blk → String #

showList ∷ [BlocksInFile blk] → ShowS #

ToExpr blk ⇒ ToExpr (BlocksInFile blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

type Rep (BlocksInFile blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.VolatileDB.Model

type Rep (BlocksInFile blk) = D1 ('MetaData "BlocksInFile" "Test.Ouroboros.Storage.VolatileDB.Model" "ouroboros-consensus-0.21.0.0-inplace-storage-test" 'True) (C1 ('MetaCons "BlocksInFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "getBlocksInFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [blk])))

blockHashesHasHeader blk ⇒ DBModel blk → [HeaderHash blk] Source #

blockIndexHasHeader blk ⇒ DBModel blk → Map (HeaderHash blk) blk Source #