Skip to content

Commit

Permalink
pin2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed May 3, 2024
1 parent 5a79e98 commit bf9c3d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Pact/Runtime/Capabilities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ import Data.Text (Text)
import Data.Maybe(fromMaybe)
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import qualified Data.Text as T

import Pact.Types.Capability
import Pact.Types.PactValue
import Pact.Types.Pretty
import Pact.Types.Runtime
import Pact.Runtime.Utils

import Debug.Trace

-- | Tie the knot with Pact.Eval by having caller supply `apply` etc
type ApplyMgrFun e = Def Ref -> PactValue -> PactValue -> Eval e PactValue
Expand Down Expand Up @@ -294,6 +296,8 @@ checkSigCaps sigs = go
qn <- MaybeT findFirstUserCall
(allowSet, wmh) <- hoistMaybe $ M.lookup qn whitelist
mh <- MaybeT $ lookupModuleHash def (_qnQual qn)
traceM $ "CURR MOD HASH: " <> T.unpack (asString mh)
traceM $ "PINNED MODULEHASH: " <> T.unpack (asString wmh)
guard (mh == wmh)
pure allowSet

Expand Down

0 comments on commit bf9c3d1

Please sign in to comment.