Skip to content

Commit

Permalink
Fix for #4924 bug that
Browse files Browse the repository at this point in the history
was introduced by #4886

readScriptDataOrFile was reverted to read ScriptData json with the detailed schema format (ScriptDataJsonDetailedSchema)
  • Loading branch information
Jimbo4350 committed Mar 6, 2023
1 parent 20c23d1 commit 0d23909
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/ScriptData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ data ScriptDataJsonBytesError

instance Error ScriptDataJsonBytesError where
displayError (ScriptDataJsonBytesErrorValue e) =
"Error decoding ScriptData JSON value: " <> show e
"Error decoding ScriptData JSON value: " <> displayError e
displayError (ScriptDataJsonBytesErrorInvalid e) =
"ScriptData is invalid: " <> show e
"ScriptData is invalid: " <> displayError e


-- | This allows us to take JSON formatted ScriptData and encode it in the CDDL format
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ readScriptDataOrFile (ScriptDataJsonFile fp) = do
sDataValue <- hoistEither . first (ScriptDataErrorJsonParse fp) $ Aeson.eitherDecode sDataBs
hoistEither
. first ScriptDataErrorJsonBytes
$ scriptDataJsonToHashable ScriptDataJsonNoSchema sDataValue
$ scriptDataJsonToHashable ScriptDataJsonDetailedSchema sDataValue

readScriptDataOrFile (ScriptDataCborFile fp) = do
origBs <- handleIOExceptT (ScriptDataErrorFile . FileIOError fp) (BS.readFile fp)
Expand Down

0 comments on commit 0d23909

Please sign in to comment.