Skip to content

Commit

Permalink
Add time to emitCek.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed Jul 19, 2021
1 parent e3e220f commit be3f972
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plutus-core/plutus-core.cabal
Expand Up @@ -5,8 +5,8 @@ license: Apache-2.0
license-files:
LICENSE
NOTICE
maintainer: vanessa.mchale@iohk.io
author: Vanessa McHale
maintainer: michael.peyton-jones@iohk.io
author: Plutus Core Team
tested-with: ghc ==8.2.2 ghc ==8.4.3 ghc ==8.6.1
synopsis: Language library for Plutus Core
description:
Expand Down Expand Up @@ -301,6 +301,7 @@ library
th-lift -any,
th-lift-instances -any,
th-utilities -any,
time -any,
transformers -any,
unordered-containers -any,
witherable -any,
Expand Down
Expand Up @@ -73,7 +73,9 @@ import Data.Proxy
import Data.STRef
import Data.Semigroup (stimes)
import Data.Text.Prettyprint.Doc
import Data.Time.Clock (getCurrentTime)
import Data.Word64Array.Word8
import System.IO.Unsafe (unsafePerformIO)
import Universe

{- Note [Compilation peculiarities]
Expand Down Expand Up @@ -472,9 +474,12 @@ spendBudgetCek = let (CekBudgetSpender spend) = ?cekBudgetSpender in spend
emitCek :: GivenCekEmitter s => String -> CekM uni fun s ()
emitCek str =
let mayLogsRef = ?cekEmitter
withTime = str ++ (show $ unsafePerformIO getCurrentTime)
in case mayLogsRef of
Nothing -> pure ()
Just logsRef -> CekCarryingM $ modifySTRef logsRef (`DList.snoc` str)
Just logsRef ->
CekCarryingM $
modifySTRef logsRef (`DList.snoc` withTime)

-- see Note [Scoping].
-- | Instantiate all the free variables of a term by looking them up in an environment.
Expand Down

0 comments on commit be3f972

Please sign in to comment.