Skip to content

Commit

Permalink
fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon authored and edmundnoble committed May 1, 2024
1 parent da76975 commit 9e192d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pact.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ library
, statistics >=0.13.3
, text >=2
, time
, transformers >= 0.5.2.0 && < 0.7
, trifecta >=2.1.1.1
, unordered-containers >=0.2.19
, utf8-string >=1.0.1.1
Expand Down Expand Up @@ -327,7 +328,6 @@ library
, sbv >=9.0
, semigroupoids >=5.0
, servant-server
, transformers >= 0.5.2.0 && < 0.7
, wai-cors
, warp
if !os(windows)
Expand Down
6 changes: 2 additions & 4 deletions src/Pact/Runtime/Capabilities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ 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
-- | More knot tying to on-demand install a managed cap
Expand Down Expand Up @@ -303,10 +301,10 @@ checkSigCaps sigs = go
wl <- checkWhiteListed
return $ M.filter (match (S.null autos) granted wl) sigs

match allowEmpty granted whitelist sigCaps =
match allowEmpty granted capsDonatingSigs sigCaps =
(S.null sigCaps && allowEmpty) ||
not (S.null (S.intersection granted sigCaps)) ||
(not (S.null whitelist) && all (\c -> S.member (_scName c) whitelist) sigCaps)
(not (S.null (S.intersection capsDonatingSigs (S.map _scName sigCaps))))

findFirstUserCall :: Eval e (Maybe QualifiedName)
findFirstUserCall = use evalCallStack >>= go
Expand Down

0 comments on commit 9e192d4

Please sign in to comment.