Skip to content

Commit

Permalink
Prefer a better variable name to an implementation comment
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Dec 1, 2023
1 parent f4c40d2 commit bb7b403
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pact-core/Pact/Core/IR/Eval/RawBuiltin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ defineKeySet'
-> m (EvalResult b i m)
defineKeySet' info cont handler env ksname newKs = do
let pdb = view cePactDb env
laxNs <- not <$> isExecutionFlagSet FlagRequireKeysetNs
ignoreNamespaces <- not <$> isExecutionFlagSet FlagRequireKeysetNs
case parseAnyKeysetName ksname of
Left {} -> returnCEK cont handler (VError "incorrect keyset name format" info)
Right ksn -> do
Expand All @@ -1058,9 +1058,7 @@ defineKeySet' info cont handler env ksname newKs = do
cond <- enforceKeyset oldKs
if cond then writeKs
else returnCEK cont handler (VError "enforce keyset failure" info)
-- `laxNs` implies the flag to require namespaces for keysets is not set,
-- so they are just not checked and get written no matter what.
Nothing | laxNs -> writeKs
Nothing | ignoreNamespaces -> writeKs
Nothing | otherwise -> useEvalState (esLoaded . loNamespace) >>= \case
Nothing -> returnCEK cont handler (VError "Cannot define a keyset outside of a namespace" info)
Just (Namespace ns uGuard _adminGuard) -> do
Expand Down

0 comments on commit bb7b403

Please sign in to comment.