Skip to content

Commit

Permalink
Merge pull request #535 from IntersectMBO/felix/any-shelley-based-era…
Browse files Browse the repository at this point in the history
…-in-read

Use AnyShelleyBasedEra in ScriptWitnessErrorReferenceScriptsNotSupportedInEra
  • Loading branch information
felix-lipski authored Dec 29, 2023
2 parents f866ae2 + 5bf655a commit 1059ef4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cardano-cli/src/Cardano/CLI/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ data ScriptWitnessError
| ScriptWitnessErrorScriptLanguageNotSupportedInEra AnyScriptLanguage AnyCardanoEra
| ScriptWitnessErrorExpectedSimple !FilePath !AnyScriptLanguage
| ScriptWitnessErrorExpectedPlutus !FilePath !AnyScriptLanguage
| ScriptWitnessErrorReferenceScriptsNotSupportedInEra !AnyCardanoEra
| ScriptWitnessErrorReferenceScriptsNotSupportedInEra !AnyShelleyBasedEra
| ScriptWitnessErrorScriptData ScriptDataError

renderScriptWitnessError :: ScriptWitnessError -> Doc ann
Expand All @@ -244,7 +244,7 @@ renderScriptWitnessError = \case
pretty file <> ": expected a script in the Plutus script language, " <>
"but it is actually using " <> pshow lang <> "."
ScriptWitnessErrorReferenceScriptsNotSupportedInEra anyEra ->
"Reference scripts not supported in era: " <> pretty anyEra
"Reference scripts not supported in era: " <> pshow anyEra
ScriptWitnessErrorScriptData sDataError ->
renderScriptDataError sDataError

Expand Down Expand Up @@ -324,8 +324,7 @@ readScriptWitness era (PlutusReferenceScriptWitnessFiles refTxIn
caseShelleyToAlonzoOrBabbageEraOnwards
( const $ left
$ ScriptWitnessErrorReferenceScriptsNotSupportedInEra
-- TODO: Update error to use AnyShelleyBasedEra
$ cardanoEraConstraints (toCardanoEra era) (AnyCardanoEra $ toCardanoEra era)
$ cardanoEraConstraints (toCardanoEra era) (AnyShelleyBasedEra era)
)
( const $
case scriptLanguageSupportedInEra era anyScriptLanguage of
Expand Down Expand Up @@ -354,7 +353,7 @@ readScriptWitness era (SimpleReferenceScriptWitnessFiles refTxIn
caseShelleyToAlonzoOrBabbageEraOnwards
( const $ left
$ ScriptWitnessErrorReferenceScriptsNotSupportedInEra
$ cardanoEraConstraints (toCardanoEra era) (AnyCardanoEra $ toCardanoEra era)
$ cardanoEraConstraints (toCardanoEra era) (AnyShelleyBasedEra era)
)
( const $
case scriptLanguageSupportedInEra era anyScriptLanguage of
Expand Down

0 comments on commit 1059ef4

Please sign in to comment.