Skip to content

Commit

Permalink
Add missing cases for DefPactGuard
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Dec 1, 2023
1 parent 338c319 commit 0e4fbb9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pact-core/Pact/Core/IR/ModuleHashing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ updateGuardHash mname mhash = \case
(updatePactValueHash mname mhash <$> pvs)
pid
GModuleGuard mg -> GModuleGuard mg
g@GDefPactGuard{} -> g

updatePactValueHash :: ModuleName -> ModuleHash -> PactValue -> PactValue
updatePactValueHash mname mhash = \case
Expand Down Expand Up @@ -225,6 +226,7 @@ encodeGuard = \case
"CapGuard" <> encodeApp (encodeFqnAsQual ct) (encodePactValue <$> args)
GModuleGuard (ModuleGuard mg n) ->
"ModuleGuard" <> parens (encodeModuleName mg <+> encodeText n)
GDefPactGuard (DefPactGuard (DefPactId dpid) name) -> "DefPactGuard" <> parens (encodeText dpid <+> encodeText name)

encodeModuleName :: ModuleName -> Builder
encodeModuleName = encodeText . renderModuleName
Expand Down

0 comments on commit 0e4fbb9

Please sign in to comment.