Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AnyShelleyBasedEra in ScriptWitnessErrorReferenceScriptsNotSupportedInEra #535

Merged
merged 1 commit into from
Dec 29, 2023
Merged
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
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
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should provide Pretty AnyShelleyBasedEra similarly to Pretty AnyCardanoEra and just use pretty instead of pshow.

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