Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 someLoE someClockSkew someChunkInfo counterexample
Where someClockSkew
and someChunkInfo
are the ones given by the
counterexample found by quickcheck-statemachine, and someLoE
is LoEEnabled
()
or LoEDisabled
.
Synopsis
- quickCheckCmdsLockStep ∷ LoE () → SmallChunkInfo → Commands (At Cmd TestBlock IO) (At Resp TestBlock IO) → IO ()
- pattern At ∷ Block SlotNo (HeaderHash blk) → Point blk
- pattern Command ∷ ∀ t1 blk1 (m1 ∷ Type → Type) t2 blk2 (m2 ∷ Type → Type). 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)
- newtype Commands (cmd ∷ (Type → Type) → Type) (resp ∷ (Type → Type) → Type) = Commands {
- unCommands ∷ [Command cmd resp]
- newtype Reference a (r ∷ Type → Type) = Reference (r a)
- data Symbolic a where
- newtype Var = Var Int
- data Cmd blk it flr
- = AddBlock blk
- | GetCurrentChain
- | GetTipBlock
- | GetTipHeader
- | GetTipPoint
- | GetBlockComponent (RealPoint blk)
- | GetGCedBlockComponent (RealPoint blk)
- | GetMaxSlotNo
- | GetIsValid (RealPoint blk)
- | Stream (StreamFrom blk) (StreamTo blk)
- | UpdateLoE (AnchoredFragment blk)
- | IteratorNext it
- | IteratorNextGCed it
- | IteratorClose it
- | NewFollower ChainType
- | FollowerInstruction flr
- | FollowerForward flr [Point blk]
- | FollowerClose flr
- | Close
- | Reopen
- | PersistBlks
- | PersistBlksThenGC
- | UpdateLedgerSnapshots
- | WipeVolatileDB
- newtype Resp blk it flr = Resp {
- getResp ∷ Either (ChainDbError blk) (Success blk it flr)
- data Success blk it flr
- = Unit ()
- | Chain (AnchoredFragment (Header blk))
- | LedgerDB (DbChangelog' blk)
- | MbBlock (Maybe blk)
- | MbAllComponents (Maybe (AllComponents blk))
- | MbGCedAllComponents (MaybeGCedBlock (AllComponents blk))
- | MbHeader (Maybe (Header blk))
- | Point (Point blk)
- | IsValid IsValidResult
- | UnknownRange (UnknownRange blk)
- | Iter it
- | IterResult (IteratorResult blk (AllComponents blk))
- | IterResultGCed (IteratorResultGCed blk)
- | Flr flr
- | MbChainUpdate (Maybe (ChainUpdate blk (AllComponents blk)))
- | MbPoint (Maybe (Point blk))
- | MaxSlot MaxSlotNo
- runCmdsLockstep ∷ LoE () → SmallChunkInfo → Commands (At Cmd Blk IO) (At Resp Blk IO) → Property
- newtype ChainLength = ChainLength Int
- data EBB
- = EBB !EpochNo
- | RegularBlock
- data SmallChunkInfo = SmallChunkInfo ChunkInfo
- data TestBlock = TestBlock {}
- data TestBody = TestBody {}
- newtype TestBodyHash = TestBodyHash Int
- data TestHeader = TestHeader {}
- newtype TestHeaderHash = TestHeaderHash Int
- data Block slot hash = Block {
- blockPointSlot ∷ !slot
- blockPointHash ∷ !hash
- newtype BlockNo = BlockNo {}
- data ChainHash (b ∷ k)
- = GenesisHash
- | BlockHash !(HeaderHash b)
- data ChainType = TentativeChain
- data ChainUpdate (block ∷ k) a = RollBack (Point block)
- data ChunkInfo = UniformChunkSize !ChunkSize
- data ChunkSize = ChunkSize {}
- newtype EpochNo = EpochNo Word64
- newtype SlotNo = SlotNo {}
Running the counterexamples
quickCheckCmdsLockStep ∷ LoE () → SmallChunkInfo → Commands (At Cmd TestBlock IO) (At Resp TestBlock IO) → IO () Source #
Patterns needed to disambiguate the At
and Command
symbols printed
pattern Command ∷ ∀ t1 blk1 (m1 ∷ Type → Type) t2 blk2 (m2 ∷ Type → Type). 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 ∷ (Type → Type) → Type) (resp ∷ (Type → Type) → Type) Source #
Constructors
Commands | |
Fields
|
newtype Reference a (r ∷ Type → Type) Source #
Constructors
Reference (r a) |
Instances
Foldable (Reference a ∷ (Type → Type) → Type) | |||||
Functor (Reference a ∷ (Type → Type) → Type) | |||||
Traversable (Reference a ∷ (Type → Type) → Type) | |||||
Defined in Test.StateMachine.Types.References | |||||
Generic (Reference a r) | |||||
Defined in Test.StateMachine.Types.References Associated Types
| |||||
Typeable a ⇒ Read (Reference a Symbolic) | |||||
(Show1 r, Show a) ⇒ Show (Reference a r) | |||||
(Eq a, Eq1 r) ⇒ Eq (Reference a r) | |||||
(Ord a, Ord1 r) ⇒ Ord (Reference a r) | |||||
Defined in Test.StateMachine.Types.References | |||||
type Rep (Reference a r) | |||||
Defined in Test.StateMachine.Types.References type Rep (Reference a r) = D1 ('MetaData "Reference" "Test.StateMachine.Types.References" "quickcheck-state-machine-0.10.1-l-no-vendored-treediff-67da96f214119492b2dc9b550f4d79aafda15376cc281c53a6b9436517dd25bb" 'True) (C1 ('MetaCons "Reference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (r a)))) |
Instances
Generic Var | |||||
Defined in Test.StateMachine.Types.References Associated Types
| |||||
Read Var | |||||
Show Var | |||||
Eq Var | |||||
Ord Var | |||||
type Rep Var | |||||
Defined in Test.StateMachine.Types.References type Rep Var = D1 ('MetaData "Var" "Test.StateMachine.Types.References" "quickcheck-state-machine-0.10.1-l-no-vendored-treediff-67da96f214119492b2dc9b550f4d79aafda15376cc281c53a6b9436517dd25bb" 'True) (C1 ('MetaCons "Var" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
ChainDB.StateMachine re-exports
Commands
Constructors
AddBlock blk | Advance the current slot to the block's slot (unless smaller than the current slot), add the block and run chain selection. |
GetCurrentChain | |
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) | |
UpdateLoE (AnchoredFragment blk) | Update the LoE fragment and run chain selection. |
IteratorNext it | |
IteratorNextGCed it | Only for blocks that may have been garbage collected. |
IteratorClose it | |
NewFollower ChainType | |
FollowerInstruction flr |
|
FollowerForward flr [Point blk] | |
FollowerClose flr | |
Close | |
Reopen | |
PersistBlks | Copy the blocks older than |
PersistBlksThenGC | Copy the blocks older than 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 |
UpdateLedgerSnapshots | Write a new |
WipeVolatileDB |
Instances
newtype Resp blk it flr Source #
Responses are either successful termination or an error.
Constructors
Resp | |
Fields
|
Instances
Bifoldable (Resp blk) Source # | |
Bifunctor (Resp blk) Source # | |
Bitraversable (Resp blk) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine Methods bitraverse ∷ Applicative f ⇒ (a → f c) → (b → f d) → Resp blk a b → f (Resp blk c d) # | |
Functor (Resp blk it) Source # | |
Foldable (Resp blk it) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine Methods fold ∷ Monoid m ⇒ Resp blk it m → m # foldMap ∷ Monoid 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 # toList ∷ Resp blk it a → [a] # length ∷ Resp blk it a → Int # elem ∷ Eq a ⇒ a → Resp blk it a → Bool # maximum ∷ Ord a ⇒ Resp blk it a → a # minimum ∷ Ord a ⇒ Resp blk it a → a # | |
Traversable (Resp blk it) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine | |
(TestConstraints blk, Show it, Show flr) ⇒ Show (Resp blk it flr) Source # | |
(TestConstraints blk, Eq it, Eq flr) ⇒ Eq (Resp blk it flr) Source # | |
(TestConstraints blk, Eq1 r) ⇒ Eq (At Resp blk m r) Source # | |
data Success blk it flr Source #
Return type for successful database operations.
Constructors
Unit () | |
Chain (AnchoredFragment (Header blk)) | |
LedgerDB (DbChangelog' blk) | |
MbBlock (Maybe blk) | |
MbAllComponents (Maybe (AllComponents blk)) | |
MbGCedAllComponents (MaybeGCedBlock (AllComponents blk)) | |
MbHeader (Maybe (Header blk)) | |
Point (Point blk) | |
IsValid IsValidResult | |
UnknownRange (UnknownRange blk) | |
Iter it | |
IterResult (IteratorResult blk (AllComponents blk)) | |
IterResultGCed (IteratorResultGCed blk) | |
Flr flr | |
MbChainUpdate (Maybe (ChainUpdate blk (AllComponents blk))) | |
MbPoint (Maybe (Point blk)) | |
MaxSlot MaxSlotNo |
Instances
Bifoldable (Success blk) Source # | |
Bifunctor (Success blk) Source # | |
Bitraversable (Success blk) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine Methods bitraverse ∷ Applicative f ⇒ (a → f c) → (b → f d) → Success blk a b → f (Success blk c d) # | |
Functor (Success blk it) Source # | |
Foldable (Success blk it) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine Methods fold ∷ Monoid m ⇒ Success blk it m → m # foldMap ∷ Monoid 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 # toList ∷ Success blk it a → [a] # null ∷ Success blk it a → Bool # length ∷ Success blk it a → Int # elem ∷ Eq a ⇒ a → Success blk it a → Bool # maximum ∷ Ord a ⇒ Success blk it a → a # minimum ∷ Ord a ⇒ Success blk it a → a # | |
Traversable (Success blk it) Source # | |
Defined in Test.Ouroboros.Storage.ChainDB.StateMachine | |
(TestConstraints blk, Show it, Show flr) ⇒ Show (Success blk it flr) Source # | |
(TestConstraints blk, Eq it, Eq flr) ⇒ Eq (Success blk it flr) Source # | |
runCmdsLockstep ∷ LoE () → SmallChunkInfo → Commands (At Cmd Blk IO) (At Resp Blk IO) → Property Source #
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 blockNo
s, 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
Enum ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods succ ∷ ChainLength → ChainLength # pred ∷ ChainLength → ChainLength # toEnum ∷ Int → ChainLength # fromEnum ∷ ChainLength → Int # enumFrom ∷ ChainLength → [ChainLength] # enumFromThen ∷ ChainLength → ChainLength → [ChainLength] # enumFromTo ∷ ChainLength → ChainLength → [ChainLength] # enumFromThenTo ∷ ChainLength → ChainLength → ChainLength → [ChainLength] # | |||||
Generic ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods showsPrec ∷ Int → ChainLength → ShowS # show ∷ ChainLength → String # showList ∷ [ChainLength] → ShowS # | |||||
Eq ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Ord ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods compare ∷ ChainLength → ChainLength → Ordering # (<) ∷ ChainLength → ChainLength → Bool # (<=) ∷ ChainLength → ChainLength → Bool # (>) ∷ ChainLength → ChainLength → Bool # (>=) ∷ ChainLength → ChainLength → Bool # max ∷ ChainLength → ChainLength → ChainLength # min ∷ ChainLength → ChainLength → ChainLength # | |||||
Hashable ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
NoThunks ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Serialise ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encode ∷ ChainLength → Encoding Source # decode ∷ Decoder s ChainLength Source # encodeList ∷ [ChainLength] → Encoding Source # decodeList ∷ Decoder s [ChainLength] Source # | |||||
ToExpr ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
type Rep ChainLength Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep ChainLength = D1 ('MetaData "ChainLength" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" 'True) (C1 ('MetaCons "ChainLength" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
Strict variant of Maybe EpochNo
Constructors
EBB !EpochNo | |
RegularBlock |
Instances
Generic EBB Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show EBB Source # | |||||
Eq EBB Source # | |||||
Hashable EBB Source # | |||||
NoThunks EBB Source # | |||||
Serialise EBB Source # | |||||
ToExpr EBB Source # | |||||
type Rep EBB Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep EBB = D1 ('MetaData "EBB" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" 'False) (C1 ('MetaCons "EBB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)) :+: C1 ('MetaCons "RegularBlock" 'PrefixI 'False) (U1 ∷ Type → Type)) |
data SmallChunkInfo Source #
Constructors
SmallChunkInfo ChunkInfo |
Instances
Arbitrary SmallChunkInfo | |
Defined in Test.Util.ChunkInfo | |
Show SmallChunkInfo | |
Defined in Test.Util.ChunkInfo Methods showsPrec ∷ Int → SmallChunkInfo → ShowS # show ∷ SmallChunkInfo → String # showList ∷ [SmallChunkInfo] → ShowS # |
Constructors
TestBlock | |
Fields
|
Instances
Generic TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||||||
Show TestBlock Source # | |||||||||
Eq TestBlock Source # | |||||||||
NoThunks TestBlock Source # | |||||||||
ConvertRawHash TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toRawHash ∷ proxy TestBlock → HeaderHash TestBlock → ByteString Source # fromRawHash ∷ proxy TestBlock → ByteString → HeaderHash TestBlock Source # toShortRawHash ∷ proxy TestBlock → HeaderHash TestBlock → ShortByteString Source # fromShortRawHash ∷ proxy TestBlock → ShortByteString → HeaderHash TestBlock Source # | |||||||||
GetHeader TestBlock Source # | |||||||||
GetPrevHash TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
BlockSupportsDiffusionPipelining TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods initialTentativeHeaderState ∷ Proxy TestBlock → TentativeHeaderState TestBlock Source # tentativeHeaderView ∷ BlockConfig TestBlock → Header TestBlock → TentativeHeaderView TestBlock Source # applyTentativeHeaderView ∷ Proxy TestBlock → TentativeHeaderView TestBlock → TentativeHeaderState TestBlock → Maybe (TentativeHeaderState TestBlock) Source # | |||||||||
BlockSupportsProtocol TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods validateView ∷ BlockConfig TestBlock → Header TestBlock → ValidateView (BlockProtocol TestBlock) Source # selectView ∷ BlockConfig TestBlock → Header TestBlock → SelectView (BlockProtocol TestBlock) Source # projectChainOrderConfig ∷ BlockConfig TestBlock → ChainOrderConfig (SelectView (BlockProtocol TestBlock)) Source # | |||||||||
HasHardForkHistory TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods hardForkSummary ∷ ∀ (mk ∷ MapKind). LedgerConfig TestBlock → LedgerState TestBlock mk → Summary (HardForkIndices TestBlock) Source # | |||||||||
BasicEnvelopeValidation TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods expectedFirstBlockNo ∷ proxy TestBlock → BlockNo Source # expectedNextBlockNo ∷ proxy TestBlock → TipInfo TestBlock → TipInfo TestBlock → BlockNo → BlockNo Source # minimumPossibleSlotNo ∷ Proxy TestBlock → SlotNo Source # minimumNextSlotNo ∷ proxy TestBlock → TipInfo TestBlock → TipInfo TestBlock → SlotNo → SlotNo Source # | |||||||||
HasAnnTip TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods getTipInfo ∷ Header TestBlock → TipInfo TestBlock Source # tipInfoHash ∷ proxy TestBlock → TipInfo TestBlock → HeaderHash TestBlock Source # | |||||||||
ValidateEnvelope TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||||||
UpdateLedger TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
InspectLedger TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods inspectLedger ∷ ∀ (mk1 ∷ MapKind) (mk2 ∷ MapKind). TopLevelConfig TestBlock → LedgerState TestBlock mk1 → LedgerState TestBlock mk2 → [LedgerEvent TestBlock] Source # | |||||||||
LedgerSupportsProtocol TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods protocolLedgerView ∷ ∀ (mk ∷ MapKind). LedgerConfig TestBlock → Ticked (LedgerState TestBlock) mk → LedgerView (BlockProtocol TestBlock) Source # ledgerViewForecastAt ∷ ∀ (mk ∷ MapKind). HasCallStack ⇒ LedgerConfig TestBlock → LedgerState TestBlock mk → Forecast (LedgerView (BlockProtocol TestBlock)) Source # | |||||||||
SerialiseDiskConstraints TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
HasBinaryBlockInfo TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods | |||||||||
Condense TestBlock Source # | |||||||||
ModelSupportsBlock TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
HasHeader TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods getHeaderFields ∷ TestBlock → HeaderFields TestBlock Source # | |||||||||
Serialise TestBlock Source # | |||||||||
ToExpr TestBlock Source # | |||||||||
HasNestedContent f TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
DecodeDisk TestBlock () Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDisk ∷ CodecConfig TestBlock → ∀ s. Decoder s () Source # | |||||||||
EncodeDisk TestBlock TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDisk ∷ CodecConfig TestBlock → TestBlock → Encoding Source # | |||||||||
EncodeDisk TestBlock () Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDisk ∷ CodecConfig TestBlock → () → Encoding Source # | |||||||||
ReconstructNestedCtxt Header TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods reconstructPrefixLen ∷ proxy (Header TestBlock) → PrefixLen Source # reconstructNestedCtxt ∷ proxy (Header TestBlock) → ShortByteString → SizeInBytes → SomeSecond (NestedCtxt Header) TestBlock Source # | |||||||||
StandardHash TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
DecodeDisk TestBlock (AnnTip TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDisk ∷ CodecConfig TestBlock → ∀ s. Decoder s (AnnTip TestBlock) Source # | |||||||||
EncodeDisk TestBlock (Header TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDisk ∷ CodecConfig TestBlock → Header TestBlock → Encoding Source # | |||||||||
EncodeDisk TestBlock (AnnTip TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDisk ∷ CodecConfig TestBlock → AnnTip TestBlock → Encoding Source # | |||||||||
DecodeDisk TestBlock (LedgerState TestBlock EmptyMK) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDisk ∷ CodecConfig TestBlock → ∀ s. Decoder s (LedgerState TestBlock EmptyMK) Source # | |||||||||
DecodeDisk TestBlock (ByteString → Header TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDisk ∷ CodecConfig TestBlock → ∀ s. Decoder s (ByteString → Header TestBlock) Source # | |||||||||
DecodeDisk TestBlock (ByteString → TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDisk ∷ CodecConfig TestBlock → ∀ s. Decoder s (ByteString → TestBlock) Source # | |||||||||
EncodeDisk TestBlock (LedgerState TestBlock EmptyMK) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDisk ∷ CodecConfig TestBlock → LedgerState TestBlock EmptyMK → Encoding Source # | |||||||||
SameDepIndex (NestedCtxt_ TestBlock f ∷ Type → Type) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods sameDepIndex ∷ NestedCtxt_ TestBlock f a → NestedCtxt_ TestBlock f b → Maybe (a :~: b) Source # | |||||||||
TrivialDependency (NestedCtxt_ TestBlock f ∷ Type → Type) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods hasSingleIndex ∷ NestedCtxt_ TestBlock f a → NestedCtxt_ TestBlock f b → a :~: b Source # indexIsTrivial ∷ NestedCtxt_ TestBlock f (TrivialIndex (NestedCtxt_ TestBlock f) ∷ Type) Source # | |||||||||
Generic (BlockConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods from ∷ BlockConfig TestBlock → Rep (BlockConfig TestBlock) x # to ∷ Rep (BlockConfig TestBlock) x → BlockConfig TestBlock # | |||||||||
Generic (CodecConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods from ∷ CodecConfig TestBlock → Rep (CodecConfig TestBlock) x # to ∷ Rep (CodecConfig TestBlock) x → CodecConfig TestBlock # | |||||||||
Generic (StorageConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods from ∷ StorageConfig TestBlock → Rep (StorageConfig TestBlock) x # to ∷ Rep (StorageConfig TestBlock) x → StorageConfig TestBlock # | |||||||||
Show (CodecConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
Show (Header TestBlock) Source # | |||||||||
Show (StorageConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
Eq (Header TestBlock) Source # | |||||||||
NoThunks (BlockConfig TestBlock) Source # | |||||||||
NoThunks (CodecConfig TestBlock) Source # | |||||||||
NoThunks (Header TestBlock) Source # | |||||||||
NoThunks (StorageConfig TestBlock) Source # | |||||||||
GetTip (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods getTip ∷ ∀ (mk ∷ MapKind). LedgerState TestBlock mk → Point (LedgerState TestBlock) Source # | |||||||||
IsLedger (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||||||
CanStowLedgerTables (LedgerState TestBlock) Source # | |||||||||
HasLedgerTables (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState TestBlock mk → LedgerTables (LedgerState TestBlock) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ LedgerState TestBlock any → LedgerTables (LedgerState TestBlock) mk → LedgerState TestBlock mk Source # | |||||||||
LedgerTablesAreTrivial (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). LedgerState TestBlock mk → LedgerState TestBlock mk' Source # | |||||||||
SignedHeader (Header TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
CanUpgradeLedgerTables (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods upgradeTables ∷ ∀ (mk1 ∷ MapKind) (mk2 ∷ MapKind). LedgerState TestBlock mk1 → LedgerState TestBlock mk2 → LedgerTables (LedgerState TestBlock) ValuesMK → LedgerTables (LedgerState TestBlock) ValuesMK Source # | |||||||||
HasHeader (Header TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods getHeaderFields ∷ Header TestBlock → HeaderFields (Header TestBlock) Source # | |||||||||
Serialise (Header TestBlock) Source # | |||||||||
ToExpr (CodecConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toExpr ∷ CodecConfig TestBlock → Expr Source # listToExpr ∷ [CodecConfig TestBlock] → Expr Source # | |||||||||
ToExpr (HeaderEnvelopeError TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toExpr ∷ HeaderEnvelopeError TestBlock → Expr Source # listToExpr ∷ [HeaderEnvelopeError TestBlock] → Expr Source # | |||||||||
ToExpr (HeaderError TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toExpr ∷ HeaderError TestBlock → Expr Source # listToExpr ∷ [HeaderError TestBlock] → Expr Source # | |||||||||
ToExpr (TipInfoIsEBB TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toExpr ∷ TipInfoIsEBB TestBlock → Expr Source # listToExpr ∷ [TipInfoIsEBB TestBlock] → Expr Source # | |||||||||
ToExpr (ExtValidationError TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
ToExpr (Tip TestBlock) Source # | |||||||||
ToExpr (DBModel TestBlock) Source # | |||||||||
ToExpr (InSlot TestBlock) Source # | |||||||||
ToExpr (IteratorModel TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.ImmutableDB.Model Methods toExpr ∷ IteratorModel TestBlock → Expr Source # listToExpr ∷ [IteratorModel TestBlock] → Expr Source # | |||||||||
ApplyBlock (LedgerState TestBlock) TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods applyBlockLedgerResultWithValidation ∷ ValidationPolicy → ComputeLedgerEvents → LedgerCfg (LedgerState TestBlock) → TestBlock → Ticked (LedgerState TestBlock) ValuesMK → Except (LedgerErr (LedgerState TestBlock)) (LedgerResult (LedgerState TestBlock) (LedgerState TestBlock DiffMK)) Source # applyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState TestBlock) → TestBlock → Ticked (LedgerState TestBlock) ValuesMK → Except (LedgerErr (LedgerState TestBlock)) (LedgerResult (LedgerState TestBlock) (LedgerState TestBlock DiffMK)) Source # reapplyBlockLedgerResult ∷ ComputeLedgerEvents → LedgerCfg (LedgerState TestBlock) → TestBlock → Ticked (LedgerState TestBlock) ValuesMK → LedgerResult (LedgerState TestBlock) (LedgerState TestBlock DiffMK) Source # getBlockKeySets ∷ TestBlock → LedgerTables (LedgerState TestBlock) KeysMK Source # | |||||||||
DecodeDiskDep (NestedCtxt Header) TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDiskDep ∷ CodecConfig TestBlock → NestedCtxt Header TestBlock a → ∀ s. Decoder s (ByteString → a) Source # | |||||||||
DecodeDiskDepIx (NestedCtxt Header) TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods decodeDiskDepIx ∷ CodecConfig TestBlock → Decoder s (SomeSecond (NestedCtxt Header) TestBlock) Source # | |||||||||
EncodeDiskDep (NestedCtxt Header) TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDiskDep ∷ CodecConfig TestBlock → NestedCtxt Header TestBlock a → a → Encoding Source # | |||||||||
EncodeDiskDepIx (NestedCtxt Header) TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encodeDiskDepIx ∷ CodecConfig TestBlock → SomeSecond (NestedCtxt Header) TestBlock → Encoding Source # | |||||||||
Generic (LedgerState TestBlock mk) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
Methods from ∷ LedgerState TestBlock mk → Rep (LedgerState TestBlock mk) x # to ∷ Rep (LedgerState TestBlock mk) x → LedgerState TestBlock mk # | |||||||||
Show (LedgerState TestBlock mk) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
Eq (LedgerState TestBlock mk) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods (==) ∷ LedgerState TestBlock mk → LedgerState TestBlock mk → Bool # (/=) ∷ LedgerState TestBlock mk → LedgerState TestBlock mk → Bool # | |||||||||
NoThunks (LedgerState TestBlock mk) Source # | |||||||||
GetTip (Ticked (LedgerState TestBlock)) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
HasLedgerTables (Ticked (LedgerState TestBlock)) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState TestBlock) mk → LedgerTables (Ticked (LedgerState TestBlock)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState TestBlock) any → LedgerTables (Ticked (LedgerState TestBlock)) mk → Ticked (LedgerState TestBlock) mk Source # | |||||||||
LedgerTablesAreTrivial (Ticked (LedgerState TestBlock)) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (LedgerState TestBlock) mk → Ticked (LedgerState TestBlock) mk' Source # | |||||||||
Serialise (LedgerState TestBlock mk) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encode ∷ LedgerState TestBlock mk → Encoding Source # decode ∷ Decoder s (LedgerState TestBlock mk) Source # encodeList ∷ [LedgerState TestBlock mk] → Encoding Source # decodeList ∷ Decoder s [LedgerState TestBlock mk] Source # | |||||||||
ToExpr (LedgerState TestBlock EmptyMK) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods toExpr ∷ LedgerState TestBlock EmptyMK → Expr Source # listToExpr ∷ [LedgerState TestBlock EmptyMK] → Expr Source # | |||||||||
IndexedMemPack (LedgerState TestBlock EmptyMK) Void Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock Methods indexedPackedByteCount ∷ LedgerState TestBlock EmptyMK → Void → Int Source # indexedPackM ∷ LedgerState TestBlock EmptyMK → Void → Pack s () Source # indexedUnpackM ∷ Buffer b ⇒ LedgerState TestBlock EmptyMK → Unpack b Void Source # indexedTypeName ∷ LedgerState TestBlock EmptyMK → String Source # | |||||||||
Show (NestedCtxt_ TestBlock f a) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type Rep TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep TestBlock = D1 ('MetaData "TestBlock" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" '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 # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type BlockProtocol TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
data CodecConfig TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
newtype Header TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
data StorageConfig TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
data NestedCtxt_ TestBlock f a Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock data NestedCtxt_ TestBlock f a where
| |||||||||
type TentativeHeaderState TestBlock Source # | |||||||||
type TentativeHeaderView TestBlock Source # | |||||||||
type HardForkIndices TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type OtherHeaderEnvelopeError TestBlock Source # | |||||||||
type TipInfo TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
data LedgerState TestBlock mk Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type LedgerUpdate TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type LedgerWarning TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type HeaderHash TestBlock Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type TrivialIndex (NestedCtxt_ TestBlock f ∷ Type → Type) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type Rep (BlockConfig TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep (BlockConfig TestBlock) = D1 ('MetaData "BlockConfig" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" '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 # | |||||||||
type Rep (StorageConfig TestBlock) Source # | |||||||||
type AuxLedgerEvent (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type LedgerCfg (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type LedgerErr (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type TxIn (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type TxOut (LedgerState TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type Signed (Header TestBlock) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||||||
type Rep (LedgerState TestBlock mk) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep (LedgerState TestBlock mk) = D1 ('MetaData "LedgerState" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" '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)))) | |||||||||
newtype Ticked (LedgerState TestBlock) (mk ∷ MapKind) Source # | |||||||||
Defined in Test.Ouroboros.Storage.TestBlock |
Constructors
TestBody | |
Fields
|
Instances
Generic TestBody Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show TestBody Source # | |||||
Eq TestBody Source # | |||||
Hashable TestBody Source # | |||||
NoThunks TestBody Source # | |||||
Serialise TestBody Source # | |||||
ToExpr TestBody Source # | |||||
type Rep TestBody Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep TestBody = D1 ('MetaData "TestBody" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" '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
Generic TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods showsPrec ∷ Int → TestBodyHash → ShowS # show ∷ TestBodyHash → String # showList ∷ [TestBodyHash] → ShowS # | |||||
Eq TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Ord TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods compare ∷ TestBodyHash → TestBodyHash → Ordering # (<) ∷ TestBodyHash → TestBodyHash → Bool # (<=) ∷ TestBodyHash → TestBodyHash → Bool # (>) ∷ TestBodyHash → TestBodyHash → Bool # (>=) ∷ TestBodyHash → TestBodyHash → Bool # max ∷ TestBodyHash → TestBodyHash → TestBodyHash # min ∷ TestBodyHash → TestBodyHash → TestBodyHash # | |||||
Hashable TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
NoThunks TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Condense TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods | |||||
Serialise TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encode ∷ TestBodyHash → Encoding Source # decode ∷ Decoder s TestBodyHash Source # encodeList ∷ [TestBodyHash] → Encoding Source # decodeList ∷ Decoder s [TestBodyHash] Source # | |||||
ToExpr TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
type Rep TestBodyHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep TestBodyHash = D1 ('MetaData "TestBodyHash" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" 'True) (C1 ('MetaCons "TestBodyHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
data TestHeader Source #
Constructors
TestHeader | |
Fields
|
Instances
Generic TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods showsPrec ∷ Int → TestHeader → ShowS # show ∷ TestHeader → String # showList ∷ [TestHeader] → ShowS # | |||||
Eq TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
NoThunks TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Condense TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods condense ∷ TestHeader → String Source # | |||||
Serialise TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encode ∷ TestHeader → Encoding Source # decode ∷ Decoder s TestHeader Source # encodeList ∷ [TestHeader] → Encoding Source # decodeList ∷ Decoder s [TestHeader] Source # | |||||
ToExpr TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
StandardHash TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
type Rep TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep TestHeader = D1 ('MetaData "TestHeader" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" 'False) (C1 ('MetaCons "TestHeader" 'PrefixI 'True) ((S1 ('MetaSel ('Just "thHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HeaderHash TestHeader)) :*: (S1 ('MetaSel ('Just "thPrevHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ChainHash TestHeader)) :*: S1 ('MetaSel ('Just "thBodyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TestBodyHash))) :*: ((S1 ('MetaSel ('Just "thSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "thBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo)) :*: (S1 ('MetaSel ('Just "thChainLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainLength) :*: S1 ('MetaSel ('Just "thIsEBB") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EBB))))) | |||||
type HeaderHash TestHeader Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock |
newtype TestHeaderHash Source #
Hash of a TestHeader
Constructors
TestHeaderHash Int |
Instances
Binary TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Generic TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Associated Types
| |||||
Show TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods showsPrec ∷ Int → TestHeaderHash → ShowS # show ∷ TestHeaderHash → String # showList ∷ [TestHeaderHash] → ShowS # | |||||
Eq TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods (==) ∷ TestHeaderHash → TestHeaderHash → Bool # (/=) ∷ TestHeaderHash → TestHeaderHash → Bool # | |||||
Ord TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods compare ∷ TestHeaderHash → TestHeaderHash → Ordering # (<) ∷ TestHeaderHash → TestHeaderHash → Bool # (<=) ∷ TestHeaderHash → TestHeaderHash → Bool # (>) ∷ TestHeaderHash → TestHeaderHash → Bool # (>=) ∷ TestHeaderHash → TestHeaderHash → Bool # | |||||
Hashable TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
NoThunks TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
Condense TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods | |||||
Serialise TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock Methods encode ∷ TestHeaderHash → Encoding Source # decode ∷ Decoder s TestHeaderHash Source # encodeList ∷ [TestHeaderHash] → Encoding Source # decodeList ∷ Decoder s [TestHeaderHash] Source # | |||||
ToExpr TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock | |||||
type Rep TestHeaderHash Source # | |||||
Defined in Test.Ouroboros.Storage.TestBlock type Rep TestHeaderHash = D1 ('MetaData "TestHeaderHash" "Test.Ouroboros.Storage.TestBlock" "ouroboros-consensus-0.25.0.0-inplace-storage-test" 'True) (C1 ('MetaCons "TestHeaderHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
Ouroboros consensus re-exports
Constructors
Block | |
Fields
|
Instances
Generic (Block slot hash) | |||||
Defined in Ouroboros.Network.Point Associated Types
| |||||
(Show slot, Show hash) ⇒ Show (Block slot hash) | |||||
(Eq slot, Eq hash) ⇒ Eq (Block slot hash) | |||||
(Ord slot, Ord hash) ⇒ Ord (Block slot hash) | |||||
Defined in Ouroboros.Network.Point Methods compare ∷ Block 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 # | |||||
(NoThunks slot, NoThunks hash) ⇒ NoThunks (Block slot hash) | |||||
type Rep (Block slot hash) | |||||
Defined in Ouroboros.Network.Point type Rep (Block slot hash) = D1 ('MetaData "Block" "Ouroboros.Network.Point" "ouroboros-network-api-0.13.0.0-5343a8071b3f542ab81b06c59cf16dafcc55f3756ea92962f719c77a1536151d" 'False) (C1 ('MetaCons "Block" 'PrefixI 'True) (S1 ('MetaSel ('Just "blockPointSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 slot) :*: S1 ('MetaSel ('Just "blockPointHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 hash))) |
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.
Instances
FromJSON BlockNo | |||||
ToJSON BlockNo | |||||
FromCBOR BlockNo | |||||
ToCBOR BlockNo | |||||
EncCBOR BlockNo | |||||
NFData BlockNo | |||||
Defined in Cardano.Slotting.Block | |||||
Bounded BlockNo | |||||
Enum BlockNo | |||||
Defined in Cardano.Slotting.Block | |||||
Generic BlockNo | |||||
Defined in Cardano.Slotting.Block Associated Types
| |||||
Num BlockNo | |||||
Show BlockNo | |||||
Eq BlockNo | |||||
Ord BlockNo | |||||
Hashable BlockNo Source # | |||||
NoThunks BlockNo | |||||
ChainOrder BlockNo | |||||
Defined in Ouroboros.Consensus.Protocol.Abstract Associated Types
Methods preferCandidate ∷ ChainOrderConfig BlockNo → BlockNo → BlockNo → Bool Source # | |||||
Condense BlockNo | |||||
Serialise BlockNo | |||||
type Rep BlockNo | |||||
Defined in Cardano.Slotting.Block type Rep BlockNo = D1 ('MetaData "BlockNo" "Cardano.Slotting.Block" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "BlockNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
type ChainOrderConfig BlockNo | |||||
Defined in Ouroboros.Consensus.Protocol.Abstract |
data ChainHash (b ∷ k) Source #
Constructors
GenesisHash | |
BlockHash !(HeaderHash b) |
Instances
Isomorphic (ChainHash ∷ Type → Type) | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary Methods project ∷ NoHardForks blk ⇒ ChainHash (HardForkBlock '[blk]) → ChainHash blk Source # inject ∷ NoHardForks blk ⇒ ChainHash blk → ChainHash (HardForkBlock '[blk]) Source # | |||||
Generic (ChainHash b) | |||||
Defined in Ouroboros.Network.Block Associated Types
| |||||
StandardHash block ⇒ Show (ChainHash block) | |||||
StandardHash block ⇒ Eq (ChainHash block) | |||||
StandardHash block ⇒ Ord (ChainHash block) | |||||
Defined in Ouroboros.Network.Block Methods compare ∷ ChainHash block → ChainHash block → Ordering # (<) ∷ ChainHash block → ChainHash block → Bool # (<=) ∷ ChainHash block → ChainHash block → Bool # (>) ∷ ChainHash block → ChainHash block → Bool # (>=) ∷ ChainHash block → ChainHash block → Bool # | |||||
(StandardHash b, Hashable (HeaderHash b)) ⇒ Hashable (ChainHash b) Source # | |||||
(StandardHash block, Typeable block) ⇒ NoThunks (ChainHash block) | |||||
Condense (ChainHash (TestBlockWith ptype)) | |||||
Defined in Test.Util.TestBlock | |||||
Condense (HeaderHash b) ⇒ Condense (ChainHash b) | |||||
Serialise (HeaderHash b) ⇒ Serialise (ChainHash b) | |||||
type Rep (ChainHash b) | |||||
Defined in Ouroboros.Network.Block type Rep (ChainHash b) = D1 ('MetaData "ChainHash" "Ouroboros.Network.Block" "ouroboros-network-api-0.13.0.0-5343a8071b3f542ab81b06c59cf16dafcc55f3756ea92962f719c77a1536151d" 'False) (C1 ('MetaCons "GenesisHash" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "BlockHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderHash b)))) |
Chain type
Follower
s 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
Generic ChainType | |||||
Defined in Ouroboros.Consensus.Storage.ChainDB.API Associated Types
| |||||
Show ChainType | |||||
Eq ChainType | |||||
type Rep ChainType | |||||
Defined in Ouroboros.Consensus.Storage.ChainDB.API |
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.
Instances
Functor (ChainUpdate block) | |
Defined in Ouroboros.Network.Block Methods fmap ∷ (a → b) → ChainUpdate block a → ChainUpdate block b # (<$) ∷ a → ChainUpdate block b → ChainUpdate block a # | |
Foldable (ChainUpdate block) | |
Defined in Ouroboros.Network.Block Methods fold ∷ Monoid m ⇒ ChainUpdate block m → m # foldMap ∷ Monoid 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 # toList ∷ ChainUpdate block a → [a] # null ∷ ChainUpdate block a → Bool # length ∷ ChainUpdate block a → Int # elem ∷ Eq a ⇒ a → ChainUpdate block a → Bool # maximum ∷ Ord a ⇒ ChainUpdate block a → a # minimum ∷ Ord a ⇒ ChainUpdate block a → a # sum ∷ Num a ⇒ ChainUpdate block a → a # product ∷ Num a ⇒ ChainUpdate block a → a # | |
Traversable (ChainUpdate block) | |
Defined in Ouroboros.Network.Block Methods traverse ∷ Applicative f ⇒ (a → f b) → ChainUpdate block a → f (ChainUpdate block b) # sequenceA ∷ Applicative f ⇒ ChainUpdate block (f a) → f (ChainUpdate block a) # mapM ∷ Monad m ⇒ (a → m b) → ChainUpdate block a → m (ChainUpdate block b) # sequence ∷ Monad m ⇒ ChainUpdate block (m a) → m (ChainUpdate block a) # | |
(StandardHash block, Show a) ⇒ Show (ChainUpdate block a) | |
Defined in Ouroboros.Network.Block Methods showsPrec ∷ Int → ChainUpdate block a → ShowS # show ∷ ChainUpdate block a → String # showList ∷ [ChainUpdate block a] → ShowS # | |
(StandardHash block, Eq a) ⇒ Eq (ChainUpdate block a) | |
Defined in Ouroboros.Network.Block Methods (==) ∷ ChainUpdate block a → ChainUpdate block a → Bool # (/=) ∷ ChainUpdate block a → ChainUpdate block a → Bool # |
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
Generic ChunkInfo | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal Associated Types
| |||||
Show ChunkInfo | |||||
NoThunks ChunkInfo | |||||
type Rep ChunkInfo | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal type Rep ChunkInfo = D1 ('MetaData "ChunkInfo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "UniformChunkSize" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChunkSize))) |
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
Generic ChunkSize | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal Associated Types
| |||||
Show ChunkSize | |||||
NoThunks ChunkSize | |||||
type Rep ChunkSize | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal type Rep ChunkSize = D1 ('MetaData "ChunkSize" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.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))) |
An epoch, i.e. the number of the epoch.
Instances
FromJSON EpochNo | |||||
ToJSON EpochNo | |||||
FromCBOR EpochNo | |||||
ToCBOR EpochNo | |||||
EncCBOR EpochNo | |||||
NFData EpochNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Enum EpochNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic EpochNo | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Show EpochNo | |||||
Eq EpochNo | |||||
Ord EpochNo | |||||
NoThunks EpochNo | |||||
Condense EpochNo | |||||
Serialise EpochNo | |||||
type Rep EpochNo | |||||
Defined in Cardano.Slotting.Slot type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
The 0-based index for the Ourboros time slot.
Instances
FromJSON SlotNo | |||||
ToJSON SlotNo | |||||
FromCBOR SlotNo | |||||
ToCBOR SlotNo | |||||
EncCBOR SlotNo | |||||
NFData SlotNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Bounded SlotNo | |||||
Enum SlotNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic SlotNo | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Num SlotNo | |||||
Show SlotNo | |||||
Eq SlotNo | |||||
Ord SlotNo | |||||
Hashable SlotNo Source # | |||||
NoThunks SlotNo | |||||
Condense SlotNo | |||||
Serialise SlotNo | |||||
ShowProxy SlotNo | |||||
(Condense block, HasHeader block, Condense (HeaderHash block)) ⇒ Condense (AnchoredFragment block) | |||||
Defined in Ouroboros.Consensus.Util.Condense Methods condense ∷ AnchoredFragment block → String Source # | |||||
HasHeader block ⇒ Anchorable (WithOrigin SlotNo) (Anchor block) block | |||||
Defined in Ouroboros.Network.AnchoredFragment | |||||
Anchorable (WithOrigin SlotNo) (HeaderStateWithTime blk) (HeaderStateWithTime blk) | |||||
Defined in Ouroboros.Consensus.HeaderStateHistory Methods asAnchor ∷ HeaderStateWithTime blk → HeaderStateWithTime blk Source # getAnchorMeasure ∷ Proxy (HeaderStateWithTime blk) → HeaderStateWithTime blk → WithOrigin SlotNo Source # | |||||
Anchorable (WithOrigin SlotNo) (ExtLedgerState TestBlock ValuesMK) (TestBlock, ExtLedgerState TestBlock ValuesMK) Source # | |||||
Defined in Test.Ouroboros.Storage.LedgerDB.StateMachine | |||||
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (StateRef m l) (StateRef m l) | |||||
type Rep SlotNo | |||||
Defined in Cardano.Slotting.Slot type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |