Skip to content

Commit

Permalink
Enforce keysets when resolving module governance
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Dec 1, 2023
1 parent 90944e7 commit 1e44b3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pact-core/Pact/Core/IR/Desugar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,11 @@ renameModule (Module unmangled mgov defs blessed imports implements mhash i) = d
pure (defn':defns, S.insert (defName defn) s, m')

resolveGov mname = \case
KeyGov ksn -> pure (KeyGov ksn)
KeyGov ksn -> case parseAnyKeysetName (_keysetName ksn) of
Left {} -> lift $ throwExecutionError i (ModuleGovernanceFailure mname)
Right ksn' -> do
lift $ enforceKeysetNameAdmin i mname ksn'
pure (KeyGov ksn')
CapGov (UnresolvedGov govName) ->
case find (\d -> BN (BareName (defName d)) == govName) defs of
Just (DCap d) -> do
Expand Down

0 comments on commit 1e44b3d

Please sign in to comment.