Skip to content

Commit

Permalink
Add getAllSpecSigners util
Browse files Browse the repository at this point in the history
  • Loading branch information
uhbif19 committed May 28, 2024
1 parent ee1d49c commit 311fd05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Cardano/CEM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ data TransitionSpec script = MkTransitionSpec
}
deriving stock (Show)

-- | List of all signing keys required for transition spec
getAllSpecSigners :: TransitionSpec script -> [PubKeyHash]
getAllSpecSigners spec = signers spec ++ txInPKHs
where
txInPKHs = mapMaybe getPubKey $ filter ((Prelude.== In) . txFanCKind) $ constraints spec
getPubKey c = case address (txFanCFilter c) of
ByPubKey key -> Just key
_ -> Nothing

{- | Static part of CEMScript datum.
Datatype is actually used only by off-chain code due to Plutus limitations.
-}
Expand Down

0 comments on commit 311fd05

Please sign in to comment.