diff --git a/ouroboros-consensus/src/unstable-tutorials/Ouroboros/Consensus/Tutorial/Simple.lhs b/ouroboros-consensus/src/unstable-tutorials/Ouroboros/Consensus/Tutorial/Simple.lhs index 30152b7f61..56c57b06b6 100644 --- a/ouroboros-consensus/src/unstable-tutorials/Ouroboros/Consensus/Tutorial/Simple.lhs +++ b/ouroboros-consensus/src/unstable-tutorials/Ouroboros/Consensus/Tutorial/Simple.lhs @@ -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 } @@ -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 @@ -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 @@ -625,7 +625,7 @@ the `ApplyBlock` typeclass: > pure $ LedgerResult { lrEvents = [] > , lrResult = block `applyBlockTo` tickedLdgrSt > } - +> > reapplyBlockLedgerResult _ldgrCfg block tickedLdgrSt = > LedgerResult { lrEvents = [] > , lrResult = block `applyBlockTo` tickedLdgrSt