Skip to content

Commit

Permalink
debug trace
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed Jul 21, 2023
1 parent 2c295ca commit d299677
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Pact/Native/Db.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import Pact.Types.Runtime
import Pact.Types.PactValue
import Pact.Types.KeySet (parseAnyKeysetName)

import Debug.Trace

class Readable a where
readable :: a -> ReadValue

Expand Down Expand Up @@ -465,7 +467,8 @@ createTable' g i [t@TTable {..}] = do
createTable' _ i as = argsError i as

guardTable :: Pretty n => FunApp -> Term n -> GuardTableOp -> Eval e ()
guardTable i TTable {..} dbop =
guardTable i TTable {..} dbop = do
traceM $ "Within guard-table for " <> show t <> " " <> show i

Check failure on line 471 in src/Pact/Native/Db.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7, 3.8, ubuntu-20.04, true, +build-tool)

|

Check failure on line 471 in src/Pact/Native/Db.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7, 3.8, ubuntu-22.04, true, +build-tool)

|

Check failure on line 471 in src/Pact/Native/Db.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7, 3.8, macOS-latest, true, +build-tool)

|

Check failure on line 471 in src/Pact/Native/Db.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04, 8.10.7, 3.8, true, -build-tool)

|

Check failure on line 471 in src/Pact/Native/Db.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-22.04, 9.0.2, 3.8, true, +build-tool)

|
checkLocalBypass $
guardForModuleCall (_faInfo i) _tModuleName $
enforceBlessedHashes i _tModuleName _tHash
Expand All @@ -484,8 +487,12 @@ guardTable i t _ = isOffChainForkedError >>= \case
enforceBlessedHashes :: FunApp -> ModuleName -> ModuleHash -> Eval e ()
enforceBlessedHashes i mn h = getModule i mn >>= \m -> case (_mdModule m) of
MDModule Module{..}
| h == _mHash -> return () -- current version ok
| h `HS.member` _mBlessed -> return () -- hash is blessed
| h == _mHash -> do
traceM $ "CURR module hash" <> show h
return () -- current version ok
| h `HS.member` _mBlessed -> do
traceM $ "Within blessed members " <> show h <> " | Blessed " <> show _mBlessed
return () -- hash is blessed
| otherwise -> evalError' i $
"Execution aborted, hash not blessed for module " <> pretty mn <> ": " <> pretty h
_ -> evalError' i $ "Internal error: expected module reference " <> pretty mn

0 comments on commit d299677

Please sign in to comment.