Skip to content

Commit eb23846

Browse files
authored
Merge pull request #1333 from IntersectMBO/jordan/fix-simple-script-deserialization
Modify readAnyScript to handle text envelope formatted simple scripts
2 parents 87c98a8 + cb3ee04 commit eb23846

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cardano-cli/src/Cardano/CLI/Read.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,12 @@ readAnyScript anyScriptFp = do
227227
Right (Exp'.AnyPlutusScript plutusScript) -> return $ Exp.AnyPlutusScript plutusScript
228228
Left e ->
229229
throwCliError $ "Failed to decode Plutus script: " <> show e
230-
Nothing -> throwCliError $ "Unsupported script language: " <> anyScriptType
230+
-- Simple script text envelope format
231+
Nothing ->
232+
case Exp.obtainCommonConstraints (Exp.useEra @era) (Exp.deserialiseSimpleScript scriptBs) of
233+
Right ss -> return $ Exp.AnySimpleScript ss
234+
Left e ->
235+
throwCliError $ "Failed to decode Simple script: " <> show (e :: CBOR.DecoderError)
231236

232237
-- | Read a script file. The file can either be in the text envelope format
233238
-- wrapping the binary representation of any of the supported script languages,

0 commit comments

Comments
 (0)