Skip to content

Commit

Permalink
fixup do not remove birds feet from Tutorial.lhs
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrisby committed Dec 12, 2024
1 parent 421d6d9 commit 70c25e7
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,34 +131,34 @@ Next, we instantiate the `ConsensusProtocol` for `SP`:

> instance ConsensusProtocol SP where
> type SelectView SP = BlockNo

>
> type LedgerView SP = ()

>
> type IsLeader SP = SP_IsLeader
> type CanBeLeader SP = SP_CanBeLeader

>
> type ChainDepState SP = ()
> type ValidateView SP = ()
> type ValidationErr SP = Void

>
> checkIsLeader cfg SP_CanBeLeader slot _tcds =
> if slot `Set.member` cfgsp_slotsLedByMe cfg
> then Just SP_IsLeader
> else Nothing

>
> protocolSecurityParam _cfg = k

>
> tickChainDepState _ _ _ _ = TickedTrivial

>
> updateChainDepState _ _ _ _ = return ()

>
> reupdateChainDepState _ _ _ _ = ()

Finally we define a few extra things used in this instantiation:

> data SP_CanBeLeader = SP_CanBeLeader -- Evidence that we /can/ be a leader
> data SP_IsLeader = SP_IsLeader -- Evidence that we /are/ leader

>
> k :: SecurityParam
> k = SecurityParam { maxRollbacks = 1 }

Expand Down Expand Up @@ -535,7 +535,7 @@ number, we materialize that number in the `LedgerState`. We'll also need to
keep track of some information about the most recent block we have seen.

> data instance LedgerState BlockC =

>
> LedgerC
> -- the hash and slot number of the most recent block
> { lsbc_tip :: Point BlockC
Expand Down Expand Up @@ -570,7 +570,7 @@ types for a ledger. Though we are here using
> instance IsLedger (LedgerState BlockC) where
> type instance LedgerErr (LedgerState BlockC) = Void
> type instance AuxLedgerEvent (LedgerState BlockC) = Void

>
> applyChainTickLedgerResult _cfg _slot ldgrSt =
> LedgerResult { lrEvents = []
> , lrResult = TickedLedgerStateC ldgrSt
Expand Down Expand Up @@ -625,7 +625,7 @@ the `ApplyBlock` typeclass:
> pure $ LedgerResult { lrEvents = []
> , lrResult = block `applyBlockTo` tickedLdgrSt
> }

>
> reapplyBlockLedgerResult _ldgrCfg block tickedLdgrSt =
> LedgerResult { lrEvents = []
> , lrResult = block `applyBlockTo` tickedLdgrSt
Expand Down

0 comments on commit 70c25e7

Please sign in to comment.