Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ scripts:
##
# Tip: Leave this as an empty string and let plutus-script-reexecutor
# error out with the expected script hash.
hash: "6bfbd8fc6567153cbaacdcd0ee9fff9e69ba2a0eb62c129b303ade19"
hash: "793f8c8cffba081b2a56462fc219cc8fe652d6a338b62c7b134876e7"
source:
# The source of the substitution script. This can either be a
# "file_path" or a "cbor_hex".
cbor_hex: "4e4d01000033222220051200120011"
inline:
type: "PlutusScriptV2"
description: "Always failing script"
cborHex: "4e4d01000033222220051200120011"
# file_path: "local-config/policy-debug.plutus"

|]
7 changes: 7 additions & 0 deletions dev-local/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ tracingYamlContents scriptsDirName = do
hash: "#{validatorDebugPolicyId}"
source:
file_path: "#{scriptsDirName}/validator-debug.plutus"
- name: "Always failing script"
hash: "793f8c8cffba081b2a56462fc219cc8fe652d6a338b62c7b134876e7"
source:
inline:
type: "PlutusScriptV2"
description: "Always failing script"
cborHex: "4e4d01000033222220051200120011"
Comment on lines +143 to +149
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking and at this and wonder, what if we use description as "names" for our scripts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this though earlier but it only is useful for inline scripts. If the scripts are in a file then the barrier to change the name is very high.

|]

escrowYamlContents :: IO String
Expand Down
6 changes: 3 additions & 3 deletions lib/PSR/ConfigMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import System.FilePath (dropFileName, (</>))
or another file on disk.
-}
data ScriptSource
= SCborHex C.TextEnvelope
= SInline C.TextEnvelope
| SFilePath FilePath
deriving (Show, Eq)

Expand Down Expand Up @@ -161,8 +161,8 @@ readScriptFile scriptYamlDir scrutScriptHash (ix, ScriptDetails{..}) = do
relativePath <- liftIO $ makeRelativeToCurrentDirectory path
liftIO $ putStrLn $ "Reading script from file: " <> relativePath
withExceptT show $ ExceptT $ C.readFileTextEnvelopeAnyOf scriptTypes (C.File relativePath)
SCborHex content ->
withExceptT show $ except $ C.deserialiseFromTextEnvelopeAnyOf scriptTypes content
SInline content -> do
withExceptT show . except $ C.deserialiseFromTextEnvelopeAnyOf scriptTypes content

let actualScriptHash =
case rsScriptFileContent of
Expand Down
Loading