-
Notifications
You must be signed in to change notification settings - Fork 720
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
Update Cardano.Api.Script in preparation for the Alonzo era #2649
Conversation
Adding a |
Thanks @johnalotoski ! |
0a35977
to
7176971
Compare
7176971
to
2868a7d
Compare
Rebased on top of #2657 and significantly extended. |
2868a7d
to
cbfc78e
Compare
cbfc78e
to
4b9ac3e
Compare
To the existing PlutusScriptVersion type which previously had no constructors at all. Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
Needed for using Plutus script witnesses. Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
The old ones and of course Plutus Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
Add the PlutusScript type itself, and adjust the existing PlutusScript constructor in the Script type to use it. Add serialisation instances for PlutusScript and extend the existing serialisation instances with the Plutus case. Extend the existing conversion functions. This patch does not cover JSON instances. Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
Change the CBOR round-trip tests to be per-language rather than per-era. We are going to remove the CBOR instances for ScriptInAnyLang and ScriptInEra, so we need the tests to cover the Script type instead, for each language.
Instead of testing per-era, we test per language instead. This means we rely on the JSON instances for the SimpleScript type rather than the ScriptInEra type. In future the ScriptInEra type will not support JSON serialisation because that type is being extended to contain Plutus scripts, and Plutus scripts do not have a native JSON representation.
And use it in more places. The existing one supported only the JSON format for the simple script language. This is a problem for Plutus since it does not have such a JSON format. The new one supports both the existing simple script JSON format and also the JSON text envelope format for all script languages, inclduing Plutus scripts. This means the simple scripts can be either in binary (via text envelope) or in JSON, while the Plutus scripts can only be binary (via the text envelope). This change means the CLI no longer relies on JSON instances fpr the Script, or ScriptInEra or ScriptInAnyLang types. It only needs the JSON instances for the SimpleScript type. This is important because those other script types have to cover Plutus and Plutus does not have such a JSON representation.
These instances are unnecessary, and are not used by the CLI. It's a bit unhelpful to provide such instances since they are not compatible with the the formats used by the Script instance for SerialiseAsCBOR. The (Script lang) instance for SerialiseAsCBOR instance provides a binary format and corresponding HasTextEnvelope type names for each language individually. The ScriptInAnyLang (and hence ScriptInEra) instance has to provide a single binary format for all languages, which means it has to use tags and is a different binary format. Providing this format is unhelpful because it is different and if it does get used by tools could lead to confusing compatibility / interop problems.
These types have to cover both the simple script languages and the Plutus language. Only the simple script language supports an external JSON representation. The Plutus languages only have a binary representation. Hence with the addition of Plutus support it is no longer possible to provide such JSON instances. This is not a problem because the SimpleScript type still has JSON instances, and those can be used where appropriate, such as in the CLI.
Add a new PlutusScriptWitness constructor to the existing ScriptWitness type. Also add ScriptDatum, ScriptRedeemer and a placeholder ScriptData type. Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
4b9ac3e
to
238c2c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
bors merge |
Build succeeded: |
No description provided.