storage-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Ouroboros.Storage.ChainDB.StateMachine.Utils.RunOnRepl

Description

Collection functions and exported symbols to be able to run a 'quickcheck-state-machine' counterexample using the GHC repl.

To test a counterexample first fire up the repl, and enable the FlexibleContexts and TypeFamilies extensions, and set multi-line input.

cabal new-repl test-storage
import Test.Ouroboros.Storage.ChainDB.StateMachine.Utils.RunOnRepl
:set -XFlexibleContexts -XTypeFamilies +m

The commands that are part of the counterexample are usually several lines long. Thus it is better to create a local definition for them:

cmds = (<PASTE THE COMMANDS OF THE COUNTEREXAMPLE HERE>)

Note the use of parentheses to prevent GHCi from ending the multiline input prematurely (the copied counterexample in this case).

Then, the model and system under tests can be tested for lockstep agreement by running:

quickCheckCmdsLockStep someClockSkew someChunkInfo counterexample

Where someClockSkew and someChunkInfo are the ones given by the counterexample found by quickcheck-statemachine.

Synopsis

Running the counterexamples

Patterns needed to disambiguate the At and Command symbols printed

pattern AtBlock SlotNo (HeaderHash blk) → Point blk Source #

pattern Command ∷ t1 blk1 (IterRef blk1 m1 Symbolic) (FollowerRef blk1 m1 Symbolic) → t2 blk2 (IterRef blk2 m2 Symbolic) (FollowerRef blk2 m2 Symbolic) → [Var] → Command (At t1 blk1 m1) (At t2 blk2 m2) Source #

Re-exports needed for compiling a StateMachine inside the repl.

quickcheck-state-machine re-exports

newtype Commands (cmd ∷ (TypeType) → Type) (resp ∷ (TypeType) → Type) Source #

Constructors

Commands 

Fields

Instances

Instances details
Monoid (Commands cmd resp) 
Instance details

Defined in Test.StateMachine.Types

Methods

memptyCommands cmd resp #

mappendCommands cmd resp → Commands cmd resp → Commands cmd resp #

mconcat ∷ [Commands cmd resp] → Commands cmd resp #

Semigroup (Commands cmd resp) 
Instance details

Defined in Test.StateMachine.Types

Methods

(<>)Commands cmd resp → Commands cmd resp → Commands cmd resp #

sconcatNonEmpty (Commands cmd resp) → Commands cmd resp #

stimesIntegral b ⇒ b → Commands cmd resp → Commands cmd resp #

(Read (cmd Symbolic), Read (resp Symbolic)) ⇒ Read (Commands cmd resp) 
Instance details

Defined in Test.StateMachine.Types

Methods

readsPrecIntReadS (Commands cmd resp) #

readListReadS [Commands cmd resp] #

readPrecReadPrec (Commands cmd resp) #

readListPrecReadPrec [Commands cmd resp] #

(Show (cmd Symbolic), Show (resp Symbolic)) ⇒ Show (Commands cmd resp) 
Instance details

Defined in Test.StateMachine.Types

Methods

showsPrecIntCommands cmd resp → ShowS #

showCommands cmd resp → String #

showList ∷ [Commands cmd resp] → ShowS #

(Eq (cmd Symbolic), Eq (resp Symbolic)) ⇒ Eq (Commands cmd resp) 
Instance details

Defined in Test.StateMachine.Types

Methods

(==)Commands cmd resp → Commands cmd resp → Bool #

(/=)Commands cmd resp → Commands cmd resp → Bool #

newtype Reference a (r ∷ TypeType) Source #

Constructors

Reference (r a) 

Instances

Instances details
Foldable (Reference a ∷ (TypeType) → Type) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

foldMapMonoid m ⇒ (∀ (x ∷ k). p x → m) → Reference a p → m Source #

Functor (Reference a ∷ (TypeType) → Type) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

fmap ∷ (∀ (x ∷ k). p x → q x) → Reference a p → Reference a q Source #

Traversable (Reference a ∷ (TypeType) → Type) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

traverseApplicative f ⇒ (∀ (a0 ∷ k). p a0 → f (q a0)) → Reference a p → f (Reference a q) Source #

Generic (Reference a r) 
Instance details

Defined in Test.StateMachine.Types.References

Associated Types

type Rep (Reference a r) ∷ TypeType #

Methods

fromReference a r → Rep (Reference a r) x #

toRep (Reference a r) x → Reference a r #

Typeable a ⇒ Read (Reference a Symbolic) 
Instance details

Defined in Test.StateMachine.Types.References

(Show1 r, Show a) ⇒ Show (Reference a r) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

showsPrecIntReference a r → ShowS #

showReference a r → String #

showList ∷ [Reference a r] → ShowS #

(Eq a, Eq1 r) ⇒ Eq (Reference a r) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

(==)Reference a r → Reference a r → Bool #

(/=)Reference a r → Reference a r → Bool #

(Ord a, Ord1 r) ⇒ Ord (Reference a r) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

compareReference a r → Reference a r → Ordering #

(<)Reference a r → Reference a r → Bool #

(<=)Reference a r → Reference a r → Bool #

(>)Reference a r → Reference a r → Bool #

(>=)Reference a r → Reference a r → Bool #

maxReference a r → Reference a r → Reference a r #

minReference a r → Reference a r → Reference a r #

type Rep (Reference a r) 
Instance details

Defined in Test.StateMachine.Types.References

type Rep (Reference a r) = D1 ('MetaData "Reference" "Test.StateMachine.Types.References" "quickcheck-state-machine-0.9.0-l-no-vendored-treediff-c029f837ba52b49df33e5a61202140048ab4f272304662c29700ab885b8fd02a" 'True) (C1 ('MetaCons "Reference" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (r a))))

data Symbolic a where Source #

Constructors

Symbolic ∷ ∀ a. Typeable a ⇒ VarSymbolic a 

Instances

Instances details
Eq1 Symbolic 
Instance details

Defined in Test.StateMachine.Types.References

Methods

liftEq ∷ (a → b → Bool) → Symbolic a → Symbolic b → Bool #

Ord1 Symbolic 
Instance details

Defined in Test.StateMachine.Types.References

Methods

liftCompare ∷ (a → b → Ordering) → Symbolic a → Symbolic b → Ordering #

Show1 Symbolic 
Instance details

Defined in Test.StateMachine.Types.References

Methods

liftShowsPrec ∷ (Int → a → ShowS) → ([a] → ShowS) → IntSymbolic a → ShowS #

liftShowList ∷ (Int → a → ShowS) → ([a] → ShowS) → [Symbolic a] → ShowS #

Typeable a ⇒ Read (Symbolic a) 
Instance details

Defined in Test.StateMachine.Types.References

Show (Symbolic a) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

showsPrecIntSymbolic a → ShowS #

showSymbolic a → String #

showList ∷ [Symbolic a] → ShowS #

Eq (Symbolic a) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

(==)Symbolic a → Symbolic a → Bool #

(/=)Symbolic a → Symbolic a → Bool #

Ord (Symbolic a) 
Instance details

Defined in Test.StateMachine.Types.References

Methods

compareSymbolic a → Symbolic a → Ordering #

(<)Symbolic a → Symbolic a → Bool #

(<=)Symbolic a → Symbolic a → Bool #

(>)Symbolic a → Symbolic a → Bool #

(>=)Symbolic a → Symbolic a → Bool #

maxSymbolic a → Symbolic a → Symbolic a #

minSymbolic a → Symbolic a → Symbolic a #

Typeable a ⇒ Read (Reference a Symbolic) 
Instance details

Defined in Test.StateMachine.Types.References

newtype Var Source #

Constructors

Var Int 

Instances

Instances details
Generic Var 
Instance details

Defined in Test.StateMachine.Types.References

Associated Types

type Rep VarTypeType #

Methods

fromVarRep Var x #

toRep Var x → Var #

Read Var 
Instance details

Defined in Test.StateMachine.Types.References

Show Var 
Instance details

Defined in Test.StateMachine.Types.References

Methods

showsPrecIntVarShowS #

showVarString #

showList ∷ [Var] → ShowS #

Eq Var 
Instance details

Defined in Test.StateMachine.Types.References

Methods

(==)VarVarBool #

(/=)VarVarBool #

Ord Var 
Instance details

Defined in Test.StateMachine.Types.References

Methods

compareVarVarOrdering #

(<)VarVarBool #

(<=)VarVarBool #

(>)VarVarBool #

(>=)VarVarBool #

maxVarVarVar #

minVarVarVar #

type Rep Var 
Instance details

Defined in Test.StateMachine.Types.References

type Rep Var = D1 ('MetaData "Var" "Test.StateMachine.Types.References" "quickcheck-state-machine-0.9.0-l-no-vendored-treediff-c029f837ba52b49df33e5a61202140048ab4f272304662c29700ab885b8fd02a" 'True) (C1 ('MetaCons "Var" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

ChainDB.StateMachine re-exports

data Cmd blk it flr Source #

Commands

Constructors

AddBlock blk

Advance the current slot to the block's slot (unless smaller than the current slot) and add the block.

AddFutureBlock blk SlotNo

Advance the current slot to the given slot, which is guaranteed to be smaller than the block's slot number (such that the block is from the future) and larger or equal to the current slot, and add the block.

GetCurrentChain 
GetLedgerDB 
GetTipBlock 
GetTipHeader 
GetTipPoint 
GetBlockComponent (RealPoint blk) 
GetGCedBlockComponent (RealPoint blk)

Only for blocks that may have been garbage collected.

GetMaxSlotNo 
GetIsValid (RealPoint blk) 
Stream (StreamFrom blk) (StreamTo blk) 
IteratorNext it 
IteratorNextGCed it

Only for blocks that may have been garbage collected.

IteratorClose it 
NewFollower ChainType 
FollowerInstruction flr

followerInstructionBlocking is excluded, as it requires multiple threads. Its code path is pretty much the same as followerInstruction anyway.

FollowerForward flr [Point blk] 
FollowerClose flr 
Close 
Reopen 
PersistBlks

Copy the blocks older than k from the Volatile DB to the Immutable DB.

PersistBlksThenGC

Copy the blocks older than k from the Volatile DB to the Immutable DB and then perform garbage colllection.

The garbage collection procedure of the Chain DB (our system under test) removes the blocks from the volatile DB without caring about whether the removed blocks were persisted. Therefore, this part of the Chain DB logic assumes that copy to the immutable DB took place before garbage collection. The model uses this assumption as well. As a result, we cannot perform garbage collection in isolation, since this will break the model's invariant.

UpdateLedgerSnapshots

Write a new Success snapshot to disk and remove the oldest ones.

WipeVolatileDB 

Instances

Instances details
Bifoldable (Cmd blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bifoldMonoid m ⇒ Cmd blk m m → m #

bifoldMapMonoid m ⇒ (a → m) → (b → m) → Cmd blk a b → m #

bifoldr ∷ (a → c → c) → (b → c → c) → c → Cmd blk a b → c #

bifoldl ∷ (c → a → c) → (c → b → c) → c → Cmd blk a b → c #

Bifunctor (Cmd blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bimap ∷ (a → b) → (c → d) → Cmd blk a c → Cmd blk b d #

first ∷ (a → b) → Cmd blk a c → Cmd blk b c #

second ∷ (b → c) → Cmd blk a b → Cmd blk a c #

Bitraversable (Cmd blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bitraverseApplicative f ⇒ (a → f c) → (b → f d) → Cmd blk a b → f (Cmd blk c d) #

Foldable (Cmd blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

foldMonoid m ⇒ Cmd blk it m → m #

foldMapMonoid m ⇒ (a → m) → Cmd blk it a → m #

foldMap'Monoid m ⇒ (a → m) → Cmd blk it a → m #

foldr ∷ (a → b → b) → b → Cmd blk it a → b #

foldr' ∷ (a → b → b) → b → Cmd blk it a → b #

foldl ∷ (b → a → b) → b → Cmd blk it a → b #

foldl' ∷ (b → a → b) → b → Cmd blk it a → b #

foldr1 ∷ (a → a → a) → Cmd blk it a → a #

foldl1 ∷ (a → a → a) → Cmd blk it a → a #

toListCmd blk it a → [a] #

nullCmd blk it a → Bool #

lengthCmd blk it a → Int #

elemEq a ⇒ a → Cmd blk it a → Bool #

maximumOrd a ⇒ Cmd blk it a → a #

minimumOrd a ⇒ Cmd blk it a → a #

sumNum a ⇒ Cmd blk it a → a #

productNum a ⇒ Cmd blk it a → a #

Traversable (Cmd blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

traverseApplicative f ⇒ (a → f b) → Cmd blk it a → f (Cmd blk it b) #

sequenceAApplicative f ⇒ Cmd blk it (f a) → f (Cmd blk it a) #

mapMMonad m ⇒ (a → m b) → Cmd blk it a → m (Cmd blk it b) #

sequenceMonad m ⇒ Cmd blk it (m a) → m (Cmd blk it a) #

Functor (Cmd blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

fmap ∷ (a → b) → Cmd blk it a → Cmd blk it b #

(<$) ∷ a → Cmd blk it b → Cmd blk it a #

CommandNames (At Cmd blk m ∷ (TypeType) → Type) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

cmdName ∷ ∀ (r ∷ k). At Cmd blk m r → String Source #

cmdNames ∷ ∀ (r ∷ k). Proxy (At Cmd blk m r) → [String] Source #

Generic (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Associated Types

type Rep (Cmd blk it flr) ∷ TypeType #

Methods

fromCmd blk it flr → Rep (Cmd blk it flr) x #

toRep (Cmd blk it flr) x → Cmd blk it flr #

(StandardHash blk, Show blk, Show it, Show flr) ⇒ Show (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

showsPrecIntCmd blk it flr → ShowS #

showCmd blk it flr → String #

showList ∷ [Cmd blk it flr] → ShowS #

Generic (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Associated Types

type Code (Cmd blk it flr) ∷ [[Type]] Source #

Methods

fromCmd blk it flr → Rep (Cmd blk it flr) Source #

toRep (Cmd blk it flr) → Cmd blk it flr Source #

HasDatatypeInfo (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Associated Types

type DatatypeInfoOf (Cmd blk it flr) ∷ DatatypeInfo Source #

Methods

datatypeInfo ∷ proxy (Cmd blk it flr) → DatatypeInfo (Code (Cmd blk it flr)) Source #

type Rep (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

type Rep (Cmd blk it flr) = D1 ('MetaData "Cmd" "Test.Ouroboros.Storage.ChainDB.StateMachine" "main" 'False) ((((C1 ('MetaCons "AddBlock" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 blk)) :+: (C1 ('MetaCons "AddFutureBlock" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 blk) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)) :+: C1 ('MetaCons "GetCurrentChain" 'PrefixI 'False) (U1TypeType))) :+: (C1 ('MetaCons "GetLedgerDB" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "GetTipBlock" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "GetTipHeader" 'PrefixI 'False) (U1TypeType)))) :+: ((C1 ('MetaCons "GetTipPoint" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "GetBlockComponent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint blk))) :+: C1 ('MetaCons "GetGCedBlockComponent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint blk))))) :+: (C1 ('MetaCons "GetMaxSlotNo" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "GetIsValid" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint blk))) :+: C1 ('MetaCons "Stream" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StreamFrom blk)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StreamTo blk))))))) :+: (((C1 ('MetaCons "IteratorNext" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 it)) :+: (C1 ('MetaCons "IteratorNextGCed" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 it)) :+: C1 ('MetaCons "IteratorClose" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 it)))) :+: (C1 ('MetaCons "NewFollower" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChainType)) :+: (C1 ('MetaCons "FollowerInstruction" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 flr)) :+: C1 ('MetaCons "FollowerForward" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 flr) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Point blk]))))) :+: ((C1 ('MetaCons "FollowerClose" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 flr)) :+: (C1 ('MetaCons "Close" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "Reopen" 'PrefixI 'False) (U1TypeType))) :+: ((C1 ('MetaCons "PersistBlks" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "PersistBlksThenGC" 'PrefixI 'False) (U1TypeType)) :+: (C1 ('MetaCons "UpdateLedgerSnapshots" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "WipeVolatileDB" 'PrefixI 'False) (U1TypeType))))))
type Code (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

type Code (Cmd blk it flr) = GCode (Cmd blk it flr)
type DatatypeInfoOf (Cmd blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

type DatatypeInfoOf (Cmd blk it flr) = GDatatypeInfoOf (Cmd blk it flr)

newtype MaxClockSkew Source #

Max clock skew in number of slots

Constructors

MaxClockSkew Word64 

newtype Resp blk it flr Source #

Responses are either successful termination or an error.

Constructors

Resp 

Fields

Instances

Instances details
Bifoldable (Resp blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bifoldMonoid m ⇒ Resp blk m m → m #

bifoldMapMonoid m ⇒ (a → m) → (b → m) → Resp blk a b → m #

bifoldr ∷ (a → c → c) → (b → c → c) → c → Resp blk a b → c #

bifoldl ∷ (c → a → c) → (c → b → c) → c → Resp blk a b → c #

Bifunctor (Resp blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bimap ∷ (a → b) → (c → d) → Resp blk a c → Resp blk b d #

first ∷ (a → b) → Resp blk a c → Resp blk b c #

second ∷ (b → c) → Resp blk a b → Resp blk a c #

Bitraversable (Resp blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bitraverseApplicative f ⇒ (a → f c) → (b → f d) → Resp blk a b → f (Resp blk c d) #

Foldable (Resp blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

foldMonoid m ⇒ Resp blk it m → m #

foldMapMonoid m ⇒ (a → m) → Resp blk it a → m #

foldMap'Monoid m ⇒ (a → m) → Resp blk it a → m #

foldr ∷ (a → b → b) → b → Resp blk it a → b #

foldr' ∷ (a → b → b) → b → Resp blk it a → b #

foldl ∷ (b → a → b) → b → Resp blk it a → b #

foldl' ∷ (b → a → b) → b → Resp blk it a → b #

foldr1 ∷ (a → a → a) → Resp blk it a → a #

foldl1 ∷ (a → a → a) → Resp blk it a → a #

toListResp blk it a → [a] #

nullResp blk it a → Bool #

lengthResp blk it a → Int #

elemEq a ⇒ a → Resp blk it a → Bool #

maximumOrd a ⇒ Resp blk it a → a #

minimumOrd a ⇒ Resp blk it a → a #

sumNum a ⇒ Resp blk it a → a #

productNum a ⇒ Resp blk it a → a #

Traversable (Resp blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

traverseApplicative f ⇒ (a → f b) → Resp blk it a → f (Resp blk it b) #

sequenceAApplicative f ⇒ Resp blk it (f a) → f (Resp blk it a) #

mapMMonad m ⇒ (a → m b) → Resp blk it a → m (Resp blk it b) #

sequenceMonad m ⇒ Resp blk it (m a) → m (Resp blk it a) #

Functor (Resp blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

fmap ∷ (a → b) → Resp blk it a → Resp blk it b #

(<$) ∷ a → Resp blk it b → Resp blk it a #

(TestConstraints blk, Show it, Show flr) ⇒ Show (Resp blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

showsPrecIntResp blk it flr → ShowS #

showResp blk it flr → String #

showList ∷ [Resp blk it flr] → ShowS #

(TestConstraints blk, Eq it, Eq flr) ⇒ Eq (Resp blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

(==)Resp blk it flr → Resp blk it flr → Bool #

(/=)Resp blk it flr → Resp blk it flr → Bool #

(TestConstraints blk, Eq1 r) ⇒ Eq (At Resp blk m r) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

(==)At Resp blk m r → At Resp blk m r → Bool #

(/=)At Resp blk m r → At Resp blk m r → Bool #

data Success blk it flr Source #

Return type for successful database operations.

Instances

Instances details
Bifoldable (Success blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bifoldMonoid m ⇒ Success blk m m → m #

bifoldMapMonoid m ⇒ (a → m) → (b → m) → Success blk a b → m #

bifoldr ∷ (a → c → c) → (b → c → c) → c → Success blk a b → c #

bifoldl ∷ (c → a → c) → (c → b → c) → c → Success blk a b → c #

Bifunctor (Success blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bimap ∷ (a → b) → (c → d) → Success blk a c → Success blk b d #

first ∷ (a → b) → Success blk a c → Success blk b c #

second ∷ (b → c) → Success blk a b → Success blk a c #

Bitraversable (Success blk) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

bitraverseApplicative f ⇒ (a → f c) → (b → f d) → Success blk a b → f (Success blk c d) #

Foldable (Success blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

foldMonoid m ⇒ Success blk it m → m #

foldMapMonoid m ⇒ (a → m) → Success blk it a → m #

foldMap'Monoid m ⇒ (a → m) → Success blk it a → m #

foldr ∷ (a → b → b) → b → Success blk it a → b #

foldr' ∷ (a → b → b) → b → Success blk it a → b #

foldl ∷ (b → a → b) → b → Success blk it a → b #

foldl' ∷ (b → a → b) → b → Success blk it a → b #

foldr1 ∷ (a → a → a) → Success blk it a → a #

foldl1 ∷ (a → a → a) → Success blk it a → a #

toListSuccess blk it a → [a] #

nullSuccess blk it a → Bool #

lengthSuccess blk it a → Int #

elemEq a ⇒ a → Success blk it a → Bool #

maximumOrd a ⇒ Success blk it a → a #

minimumOrd a ⇒ Success blk it a → a #

sumNum a ⇒ Success blk it a → a #

productNum a ⇒ Success blk it a → a #

Traversable (Success blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

traverseApplicative f ⇒ (a → f b) → Success blk it a → f (Success blk it b) #

sequenceAApplicative f ⇒ Success blk it (f a) → f (Success blk it a) #

mapMMonad m ⇒ (a → m b) → Success blk it a → m (Success blk it b) #

sequenceMonad m ⇒ Success blk it (m a) → m (Success blk it a) #

Functor (Success blk it) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

fmap ∷ (a → b) → Success blk it a → Success blk it b #

(<$) ∷ a → Success blk it b → Success blk it a #

(TestConstraints blk, Show it, Show flr) ⇒ Show (Success blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

showsPrecIntSuccess blk it flr → ShowS #

showSuccess blk it flr → String #

showList ∷ [Success blk it flr] → ShowS #

(TestConstraints blk, Eq it, Eq flr) ⇒ Eq (Success blk it flr) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ChainDB.StateMachine

Methods

(==)Success blk it flr → Success blk it flr → Bool #

(/=)Success blk it flr → Success blk it flr → Bool #

Test packages re-exports

newtype ChainLength Source #

In chain selection, we use BlockNo as a proxy for the block length. This is entirely correct, except for those dreadful EBBs, which share their block number with their predecessor. So it is possible that two chains with the same BlockNo at the tip have a different length because the longer chain contains more EBBs than the shorter.

For example:

.. :> EBB (100, slotNo 10, blockNo 1) :> (400, slotNo 10, blockNo 2)
.. :> (999, slotNo 10, blockNo 2)

The chain selection for this TestBlock looks at the hashes in case of a BlockNo tie (after prefering the chain ending with an EBB) and will pick the block with the highest hash. This is to have a more deterministic chain selection (less implementation specific) which will keep the model better in sync with the implementation.

In the example above, that would mean picking the second chain, /even though it is shorter/! The implementation does not support switching to a shorter chain.

Note that this is not a problem for Byron, because we don't look at the hashes or anything else in case of a tie (we just prefer a chain ending with an EBB, which must be longer).

Note that is not a problem for Shelley either, where we do look at the certificate number and VRF hash in case of a tie, because there are no EBBs.

This is only an issue when: * There can be EBBs in the chain * In case of equal blockNos, we still prefer one over the other because of some additional condition.

Which is the case for this TestBlock.

To solve this, we store the real chain length inside the block. The only difference with the BlockNo is that ChainLength takes EBBs into account.

When there is BlockNo tie as in the example above and we would look at the hashes, we will first look at the ChainLength (and prefer the longest one). Only if that is equal do we actually look at the hashes. This guarantees that we never prefer a chain that is shorter.

NOTE: we start counting from 1 (unlike BlockNo, which starts from 0), because it corresponds to the length.

Constructors

ChainLength Int 

Instances

Instances details
Enum ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Generic ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep ChainLengthTypeType #

Show ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Ord ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Hashable ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep ChainLength Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep ChainLength = D1 ('MetaData "ChainLength" "Test.Ouroboros.Storage.TestBlock" "main" 'True) (C1 ('MetaCons "ChainLength" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data EBB Source #

Strict variant of Maybe EpochNo

Constructors

EBB !EpochNo 
RegularBlock 

Instances

Instances details
Generic EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep EBBTypeType #

Methods

fromEBBRep EBB x #

toRep EBB x → EBB #

Show EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

showsPrecIntEBBShowS #

showEBBString #

showList ∷ [EBB] → ShowS #

Eq EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

(==)EBBEBBBool #

(/=)EBBEBBBool #

Hashable EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

hashWithSaltIntEBBInt Source #

hashEBBInt Source #

NoThunks EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

toExprEBBExpr Source #

listToExpr ∷ [EBB] → Expr Source #

type Rep EBB Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep EBB = D1 ('MetaData "EBB" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "EBB" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)) :+: C1 ('MetaCons "RegularBlock" 'PrefixI 'False) (U1TypeType))

data SmallChunkInfo Source #

Instances

Instances details
Arbitrary SmallChunkInfo 
Instance details

Defined in Test.Util.ChunkInfo

Show SmallChunkInfo 
Instance details

Defined in Test.Util.ChunkInfo

data TestBlock Source #

Constructors

TestBlock 

Instances

Instances details
Generic TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep TestBlockTypeType #

Methods

fromTestBlockRep TestBlock x #

toRep TestBlock x → TestBlock #

Show TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

showsPrecIntTestBlockShowS #

showTestBlockString #

showList ∷ [TestBlock] → ShowS #

Eq TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

(==)TestBlockTestBlockBool #

(/=)TestBlockTestBlockBool #

ModelSupportsBlock TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ConvertRawHash TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

GetHeader TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

GetPrevHash TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

BlockSupportsDiffusionPipelining TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

BlockSupportsProtocol TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasHardForkHistory TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type HardForkIndices TestBlock ∷ [Type] Source #

BasicEnvelopeValidation TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasAnnTip TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type TipInfo TestBlock Source #

ValidateEnvelope TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

UpdateLedger TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

InspectLedger TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

LedgerSupportsProtocol TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

SerialiseDiskConstraints TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasBinaryBlockInfo TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Condense TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasHeader TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasNestedContent f TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDisk TestBlock () Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

decodeDiskCodecConfig TestBlock → ∀ s. Decoder s () Source #

EncodeDisk TestBlock TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDisk TestBlock () Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ReconstructNestedCtxt Header TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

StandardHash TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDisk TestBlock (AnnTip TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDisk TestBlock (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDisk TestBlock (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDisk TestBlock (AnnTip TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDisk TestBlock (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDisk TestBlock (ByteStringTestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDisk TestBlock (ByteStringHeader TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Generic (BlockConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep (BlockConfig TestBlock) ∷ TypeType #

Generic (CodecConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep (CodecConfig TestBlock) ∷ TypeType #

Generic (StorageConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep (StorageConfig TestBlock) ∷ TypeType #

Generic (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep (LedgerState TestBlock) ∷ TypeType #

Show (CodecConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Show (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Show (StorageConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Show (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks (BlockConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks (CodecConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks (StorageConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

GetTip (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

GetTip (Ticked (LedgerState TestBlock)) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

IsLedger (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

SignedHeader (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

HasHeader (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (DBModel TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ImmutableDB.Model

ToExpr (InSlot TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ImmutableDB.Model

ToExpr (IteratorModel TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.ImmutableDB.Model

ToExpr (CodecConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (HeaderEnvelopeError TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (HeaderError TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (TipInfoIsEBB TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (ExtValidationError TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr (Tip TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ApplyBlock (LedgerState TestBlock) TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDiskDep (NestedCtxt Header) TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

DecodeDiskDepIx (NestedCtxt Header) TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDiskDep (NestedCtxt Header) TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

EncodeDiskDepIx (NestedCtxt Header) TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

SameDepIndex (NestedCtxt_ TestBlock f) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

TrivialDependency (NestedCtxt_ TestBlock f) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type TrivialIndex (NestedCtxt_ TestBlock f) Source #

Show (NestedCtxt_ TestBlock f a) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBlock = D1 ('MetaData "TestBlock" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "testHeader") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TestHeader) :*: S1 ('MetaSel ('Just "testBody") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TestBody)))
data BlockConfig TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type BlockProtocol TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data CodecConfig TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

newtype Header TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data StorageConfig TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data NestedCtxt_ TestBlock f a Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data NestedCtxt_ TestBlock f a where
type TentativeHeaderState TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type TentativeHeaderView TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type HardForkIndices TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type OtherHeaderEnvelopeError TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type TipInfo TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data LedgerState TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type LedgerUpdate TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type LedgerWarning TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type HeaderHash TestBlock Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep (BlockConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep (BlockConfig TestBlock) = D1 ('MetaData "BlockConfig" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestBlockConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "testBlockEBBsAllowed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "testBlockNumCoreNodes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NumCoreNodes)))
type Rep (CodecConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep (CodecConfig TestBlock) = D1 ('MetaData "CodecConfig" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestBlockCodecConfig" 'PrefixI 'False) (U1TypeType))
type Rep (StorageConfig TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep (StorageConfig TestBlock) = D1 ('MetaData "StorageConfig" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestBlockStorageConfig" 'PrefixI 'False) (U1TypeType))
type Rep (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep (LedgerState TestBlock) = D1 ('MetaData "LedgerState" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestLedger" 'PrefixI 'True) (S1 ('MetaSel ('Just "lastAppliedPoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point TestBlock)) :*: S1 ('MetaSel ('Just "lastAppliedHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ChainHash TestBlock))))
type AuxLedgerEvent (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type LedgerCfg (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type LedgerErr (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Signed (Header TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Signed (Header TestBlock) = ()
newtype Ticked (LedgerState TestBlock) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type TrivialIndex (NestedCtxt_ TestBlock f) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

data TestBody Source #

Constructors

TestBody 

Fields

  • tbForkNo ∷ !Word

    If we don't have something that can vary per block, we're not generating forks, except when skipping slots. For example, when we want to have multiple different valid successor blocks created in the same slot, all fields in the header and body will be the same. Consequently, the hashes will also be the same, so we don't have different blocks after all. By using a different tbForkNo for each block, we have different bodies, and thus different hashes.

    Note that this is a local number, it is specific to this block, other blocks need not be aware of it.

  • tbIsValid ∷ !Bool
     

Instances

Instances details
Generic TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep TestBodyTypeType #

Methods

fromTestBodyRep TestBody x #

toRep TestBody x → TestBody #

Show TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

showsPrecIntTestBodyShowS #

showTestBodyString #

showList ∷ [TestBody] → ShowS #

Eq TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

(==)TestBodyTestBodyBool #

(/=)TestBodyTestBodyBool #

Hashable TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBody Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBody = D1 ('MetaData "TestBody" "Test.Ouroboros.Storage.TestBlock" "main" 'False) (C1 ('MetaCons "TestBody" 'PrefixI 'True) (S1 ('MetaSel ('Just "tbForkNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Just "tbIsValid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))

newtype TestBodyHash Source #

Hash of a TestBody

Constructors

TestBodyHash Int 

Instances

Instances details
Generic TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep TestBodyHashTypeType #

Show TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Ord TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Hashable TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Condense TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBodyHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestBodyHash = D1 ('MetaData "TestBodyHash" "Test.Ouroboros.Storage.TestBlock" "main" 'True) (C1 ('MetaCons "TestBodyHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data TestHeader Source #

Constructors

TestHeader 

Fields

Instances

Instances details
Generic TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep TestHeaderTypeType #

Show TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

(==)TestHeaderTestHeaderBool #

(/=)TestHeaderTestHeaderBool #

NoThunks TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Condense TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

StandardHash TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type HeaderHash TestHeader Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

newtype TestHeaderHash Source #

Hash of a TestHeader

Constructors

TestHeaderHash Int 

Instances

Instances details
Generic TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Associated Types

type Rep TestHeaderHashTypeType #

Show TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Binary TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Eq TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Ord TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Hashable TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

NoThunks TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Condense TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Serialise TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

ToExpr TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestHeaderHash Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

type Rep TestHeaderHash = D1 ('MetaData "TestHeaderHash" "Test.Ouroboros.Storage.TestBlock" "main" 'True) (C1 ('MetaCons "TestHeaderHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Ouroboros consensus re-exports

data Block slot hash Source #

Constructors

Block 

Fields

Instances

Instances details
Generic (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

Associated Types

type Rep (Block slot hash) ∷ TypeType #

Methods

fromBlock slot hash → Rep (Block slot hash) x #

toRep (Block slot hash) x → Block slot hash #

(Show slot, Show hash) ⇒ Show (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

Methods

showsPrecIntBlock slot hash → ShowS #

showBlock slot hash → String #

showList ∷ [Block slot hash] → ShowS #

(Eq slot, Eq hash) ⇒ Eq (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

Methods

(==)Block slot hash → Block slot hash → Bool #

(/=)Block slot hash → Block slot hash → Bool #

(Ord slot, Ord hash) ⇒ Ord (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

Methods

compareBlock slot hash → Block slot hash → Ordering #

(<)Block slot hash → Block slot hash → Bool #

(<=)Block slot hash → Block slot hash → Bool #

(>)Block slot hash → Block slot hash → Bool #

(>=)Block slot hash → Block slot hash → Bool #

maxBlock slot hash → Block slot hash → Block slot hash #

minBlock slot hash → Block slot hash → Block slot hash #

(NoThunks slot, NoThunks hash) ⇒ NoThunks (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

Methods

noThunksContextBlock slot hash → IO (Maybe ThunkInfo) Source #

wNoThunksContextBlock slot hash → IO (Maybe ThunkInfo) Source #

showTypeOfProxy (Block slot hash) → String Source #

type Rep (Block slot hash) 
Instance details

Defined in Ouroboros.Network.Point

type Rep (Block slot hash) = D1 ('MetaData "Block" "Ouroboros.Network.Point" "ouroboros-network-api-0.7.2.0-0bea7b823cbda00590f7ea5f9786d7648393f2aa10b0aef7b53ea3ea0094c568" 'False) (C1 ('MetaCons "Block" 'PrefixI 'True) (S1 ('MetaSel ('Just "blockPointSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 slot) :*: S1 ('MetaSel ('Just "blockPointHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 hash)))

newtype BlockNo Source #

The 0-based index of the block in the blockchain. BlockNo is <= SlotNo and is only equal at slot N if there is a block for every slot where N <= SlotNo.

Constructors

BlockNo 

Fields

Instances

Instances details
FromJSON BlockNo 
Instance details

Defined in Cardano.Slotting.Block

ToJSON BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Bounded BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Enum BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Generic BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Associated Types

type Rep BlockNoTypeType #

Methods

fromBlockNoRep BlockNo x #

toRep BlockNo x → BlockNo #

Num BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Show BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

showsPrecIntBlockNoShowS #

showBlockNoString #

showList ∷ [BlockNo] → ShowS #

FromCBOR BlockNo 
Instance details

Defined in Cardano.Slotting.Block

ToCBOR BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

toCBORBlockNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy BlockNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [BlockNo] → Size Source #

NFData BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

rnfBlockNo → () #

Eq BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

(==)BlockNoBlockNoBool #

(/=)BlockNoBlockNoBool #

Ord BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

compareBlockNoBlockNoOrdering #

(<)BlockNoBlockNoBool #

(<=)BlockNoBlockNoBool #

(>)BlockNoBlockNoBool #

(>=)BlockNoBlockNoBool #

maxBlockNoBlockNoBlockNo #

minBlockNoBlockNoBlockNo #

Hashable BlockNo Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

hashWithSaltIntBlockNoInt Source #

hashBlockNoInt Source #

NoThunks BlockNo 
Instance details

Defined in Cardano.Slotting.Block

ChainOrder BlockNo 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Associated Types

type ChainOrderConfig BlockNo Source #

Condense BlockNo 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseBlockNoString Source #

Serialise BlockNo 
Instance details

Defined in Cardano.Slotting.Block

type Rep BlockNo 
Instance details

Defined in Cardano.Slotting.Block

type Rep BlockNo = D1 ('MetaData "BlockNo" "Cardano.Slotting.Block" "cardano-slotting-0.2.0.0-efb016fbe9e168c0ff2b2dc78099f0dcce58de3212bf5f1627b43e6c92636bbb" 'True) (C1 ('MetaCons "BlockNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
type ChainOrderConfig BlockNo 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

data ChainHash (b ∷ k) Source #

Constructors

GenesisHash 
BlockHash !(HeaderHash b) 

Instances

Instances details
Generic (ChainHash b) 
Instance details

Defined in Ouroboros.Network.Block

Associated Types

type Rep (ChainHash b) ∷ TypeType #

Methods

fromChainHash b → Rep (ChainHash b) x #

toRep (ChainHash b) x → ChainHash b #

StandardHash block ⇒ Show (ChainHash block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

showsPrecIntChainHash block → ShowS #

showChainHash block → String #

showList ∷ [ChainHash block] → ShowS #

StandardHash block ⇒ Eq (ChainHash block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

(==)ChainHash block → ChainHash block → Bool #

(/=)ChainHash block → ChainHash block → Bool #

StandardHash block ⇒ Ord (ChainHash block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

compareChainHash block → ChainHash block → Ordering #

(<)ChainHash block → ChainHash block → Bool #

(<=)ChainHash block → ChainHash block → Bool #

(>)ChainHash block → ChainHash block → Bool #

(>=)ChainHash block → ChainHash block → Bool #

maxChainHash block → ChainHash block → ChainHash block #

minChainHash block → ChainHash block → ChainHash block #

(StandardHash b, Hashable (HeaderHash b)) ⇒ Hashable (ChainHash b) Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

hashWithSaltIntChainHash b → Int Source #

hashChainHash b → Int Source #

(StandardHash block, Typeable block) ⇒ NoThunks (ChainHash block) 
Instance details

Defined in Ouroboros.Network.Block

Condense (ChainHash (TestBlockWith ptype)) 
Instance details

Defined in Test.Util.TestBlock

Condense (HeaderHash b) ⇒ Condense (ChainHash b) 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseChainHash b → String Source #

Serialise (HeaderHash b) ⇒ Serialise (ChainHash b) 
Instance details

Defined in Ouroboros.Network.Block

type Rep (ChainHash b) 
Instance details

Defined in Ouroboros.Network.Block

type Rep (ChainHash b) = D1 ('MetaData "ChainHash" "Ouroboros.Network.Block" "ouroboros-network-api-0.7.2.0-0bea7b823cbda00590f7ea5f9786d7648393f2aa10b0aef7b53ea3ea0094c568" 'False) (C1 ('MetaCons "GenesisHash" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BlockHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderHash b))))

data ChainType Source #

Chain type

Followers can choose to track changes to the "normal" SelectedChain, or track the TentativeChain, which might contain a pipelineable header at the tip.

Constructors

TentativeChain 

Instances

Instances details
Generic ChainType 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.API

Associated Types

type Rep ChainTypeTypeType #

Methods

fromChainTypeRep ChainType x #

toRep ChainType x → ChainType #

Show ChainType 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.API

Methods

showsPrecIntChainTypeShowS #

showChainTypeString #

showList ∷ [ChainType] → ShowS #

Eq ChainType 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.API

Methods

(==)ChainTypeChainTypeBool #

(/=)ChainTypeChainTypeBool #

type Rep ChainType 
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.API

type Rep ChainType = D1 ('MetaData "ChainType" "Ouroboros.Consensus.Storage.ChainDB.API" "ouroboros-consensus-0.18.0.0-inplace" 'False) (C1 ('MetaCons "SelectedChain" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "TentativeChain" 'PrefixI 'False) (U1TypeType))

data ChainUpdate (block ∷ k) a Source #

A representation of two actions to update a chain: add a block or roll back to a previous point.

The type parameter a is there to allow a Functor instance. Typically, it will be instantiated with block itself.

Constructors

RollBack (Point block) 

Instances

Instances details
Foldable (ChainUpdate block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

foldMonoid m ⇒ ChainUpdate block m → m #

foldMapMonoid m ⇒ (a → m) → ChainUpdate block a → m #

foldMap'Monoid m ⇒ (a → m) → ChainUpdate block a → m #

foldr ∷ (a → b → b) → b → ChainUpdate block a → b #

foldr' ∷ (a → b → b) → b → ChainUpdate block a → b #

foldl ∷ (b → a → b) → b → ChainUpdate block a → b #

foldl' ∷ (b → a → b) → b → ChainUpdate block a → b #

foldr1 ∷ (a → a → a) → ChainUpdate block a → a #

foldl1 ∷ (a → a → a) → ChainUpdate block a → a #

toListChainUpdate block a → [a] #

nullChainUpdate block a → Bool #

lengthChainUpdate block a → Int #

elemEq a ⇒ a → ChainUpdate block a → Bool #

maximumOrd a ⇒ ChainUpdate block a → a #

minimumOrd a ⇒ ChainUpdate block a → a #

sumNum a ⇒ ChainUpdate block a → a #

productNum a ⇒ ChainUpdate block a → a #

Traversable (ChainUpdate block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

traverseApplicative f ⇒ (a → f b) → ChainUpdate block a → f (ChainUpdate block b) #

sequenceAApplicative f ⇒ ChainUpdate block (f a) → f (ChainUpdate block a) #

mapMMonad m ⇒ (a → m b) → ChainUpdate block a → m (ChainUpdate block b) #

sequenceMonad m ⇒ ChainUpdate block (m a) → m (ChainUpdate block a) #

Functor (ChainUpdate block) 
Instance details

Defined in Ouroboros.Network.Block

Methods

fmap ∷ (a → b) → ChainUpdate block a → ChainUpdate block b #

(<$) ∷ a → ChainUpdate block b → ChainUpdate block a #

(StandardHash block, Show a) ⇒ Show (ChainUpdate block a) 
Instance details

Defined in Ouroboros.Network.Block

Methods

showsPrecIntChainUpdate block a → ShowS #

showChainUpdate block a → String #

showList ∷ [ChainUpdate block a] → ShowS #

(StandardHash block, Eq a) ⇒ Eq (ChainUpdate block a) 
Instance details

Defined in Ouroboros.Network.Block

Methods

(==)ChainUpdate block a → ChainUpdate block a → Bool #

(/=)ChainUpdate block a → ChainUpdate block a → Bool #

data ChunkInfo Source #

Size of the chunks of the immutable DB

This is the key data structure that drives all layout functions.

TODO: Add support for non-uniform ChunkInfo https://github.com/IntersectMBO/ouroboros-network/issues/1754

Constructors

UniformChunkSize !ChunkSize

A single, uniform, chunk size

If EBBs are present, the chunk size must line up precisely with the epoch size (that is, the number of regular blocks in the chunk must equal the number of regular blocks in an epoch).

Instances

Instances details
Generic ChunkInfo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Associated Types

type Rep ChunkInfoTypeType #

Methods

fromChunkInfoRep ChunkInfo x #

toRep ChunkInfo x → ChunkInfo #

Show ChunkInfo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

showsPrecIntChunkInfoShowS #

showChunkInfoString #

showList ∷ [ChunkInfo] → ShowS #

NoThunks ChunkInfo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkInfo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkInfo = D1 ('MetaData "ChunkInfo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.18.0.0-inplace" 'False) (C1 ('MetaCons "UniformChunkSize" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChunkSize)))

data ChunkSize Source #

Size of a chunk

The total number of slots available in a chunk is equal to numRegularBlocks if not chunkCanContainEBB, and numRegularBlocks + 1 otherwise.

Constructors

ChunkSize 

Fields

Instances

Instances details
Generic ChunkSize 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Associated Types

type Rep ChunkSizeTypeType #

Methods

fromChunkSizeRep ChunkSize x #

toRep ChunkSize x → ChunkSize #

Show ChunkSize 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

showsPrecIntChunkSizeShowS #

showChunkSizeString #

showList ∷ [ChunkSize] → ShowS #

NoThunks ChunkSize 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkSize 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkSize = D1 ('MetaData "ChunkSize" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.18.0.0-inplace" 'False) (C1 ('MetaCons "ChunkSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "chunkCanContainEBB") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "numRegularBlocks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))

newtype EpochNo Source #

An epoch, i.e. the number of the epoch.

Constructors

EpochNo Word64 

Instances

Instances details
FromJSON EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Enum EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Generic EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep EpochNoTypeType #

Methods

fromEpochNoRep EpochNo x #

toRep EpochNo x → EpochNo #

Show EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntEpochNoShowS #

showEpochNoString #

showList ∷ [EpochNo] → ShowS #

FromCBOR EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOREpochNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochNo] → Size Source #

NFData EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfEpochNo → () #

Eq EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)EpochNoEpochNoBool #

(/=)EpochNoEpochNoBool #

Ord EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

compareEpochNoEpochNoOrdering #

(<)EpochNoEpochNoBool #

(<=)EpochNoEpochNoBool #

(>)EpochNoEpochNoBool #

(>=)EpochNoEpochNoBool #

maxEpochNoEpochNoEpochNo #

minEpochNoEpochNoEpochNo #

NoThunks EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Condense EpochNo 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseEpochNoString Source #

Serialise EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-efb016fbe9e168c0ff2b2dc78099f0dcce58de3212bf5f1627b43e6c92636bbb" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype SlotNo Source #

The 0-based index for the Ourboros time slot.

Constructors

SlotNo 

Fields

Instances

Instances details
FromJSON SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

ToJSON SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Bounded SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Enum SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Generic SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep SlotNoTypeType #

Methods

fromSlotNoRep SlotNo x #

toRep SlotNo x → SlotNo #

Num SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(+)SlotNoSlotNoSlotNo #

(-)SlotNoSlotNoSlotNo #

(*)SlotNoSlotNoSlotNo #

negateSlotNoSlotNo #

absSlotNoSlotNo #

signumSlotNoSlotNo #

fromIntegerIntegerSlotNo #

Show SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

showsPrecIntSlotNoShowS #

showSlotNoString #

showList ∷ [SlotNo] → ShowS #

FromCBOR SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBORSlotNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotNo] → Size Source #

NFData SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnfSlotNo → () #

Eq SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

(==)SlotNoSlotNoBool #

(/=)SlotNoSlotNoBool #

Ord SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

compareSlotNoSlotNoOrdering #

(<)SlotNoSlotNoBool #

(<=)SlotNoSlotNoBool #

(>)SlotNoSlotNoBool #

(>=)SlotNoSlotNoBool #

maxSlotNoSlotNoSlotNo #

minSlotNoSlotNoSlotNo #

Hashable SlotNo Source # 
Instance details

Defined in Test.Ouroboros.Storage.TestBlock

Methods

hashWithSaltIntSlotNoInt Source #

hashSlotNoInt Source #

NoThunks SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Condense SlotNo 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseSlotNoString Source #

Serialise SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

ShowProxy SlotNo 
Instance details

Defined in Ouroboros.Network.Util.ShowProxy

(Condense block, HasHeader block, Condense (HeaderHash block)) ⇒ Condense (AnchoredFragment block) 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseAnchoredFragment block → String Source #

HasHeader block ⇒ Anchorable (WithOrigin SlotNo) (Anchor block) block 
Instance details

Defined in Ouroboros.Network.AnchoredFragment

Methods

asAnchor ∷ block → Anchor block Source #

getAnchorMeasureProxy block → Anchor block → WithOrigin SlotNo Source #

Anchorable (WithOrigin SlotNo) (HeaderState blk) (HeaderState blk)

Used by HeaderStateHistory but defined here, where it is not an orphan.

Instance details

Defined in Ouroboros.Consensus.HeaderValidation

GetTip l ⇒ Anchorable (WithOrigin SlotNo) (Checkpoint l) (Checkpoint l) 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.LedgerDB

type Rep SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-efb016fbe9e168c0ff2b2dc78099f0dcce58de3212bf5f1627b43e6c92636bbb" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))