Skip to content

Commit

Permalink
Simplify the pushAndTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
EncodePanda committed Dec 6, 2021
1 parent 68b9a6c commit 4a5633a
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,11 @@ ledgerDbPushMany ::
ledgerDbPushMany trace cfg aps initDb = (repeatedlyM pushAndTrace) aps initDb
where
pushAndTrace ap db = do
traceStep $ StartedPushingBlockToTheLedgerDb (Pushing $ toRealPoint ap)
let pushing = Pushing . toRealPoint $ ap
goal = PushGoal . toRealPoint . last $ aps
trace $ StartedPushingBlockToTheLedgerDb pushing goal
ledgerDbPush cfg ap db

traceStep :: (PushGoal blk -> UpdateLedgerDbTraceEvent blk) -> m ()
traceStep step =
let goal = PushGoal . toRealPoint . last $ aps
event = step goal
in trace event

-- | Switch to a fork
ledgerDbSwitch :: (ApplyBlock l blk, Monad m, c)
=> LedgerDbCfg l
Expand Down

0 comments on commit 4a5633a

Please sign in to comment.