-
Notifications
You must be signed in to change notification settings - Fork 481
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
SCP-1879: Export serialised PLC programs with envelopes #3358
Conversation
@michaelpj Is this what you had in mind? |
073aad7
to
415ed4d
Compare
Yep, perfect. Two things to think about:
|
Exporting the instances in |
Well, we certainly can't put it there since |
0e7e053
to
f60d7e5
Compare
f60d7e5
to
65acd85
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.
Argh, sorry, forgot to actually click submit review...
You can translate directly into CBOR using the `Serialise` typeclass from the `serialise` package. | ||
Or you can create an envelope of the sort used by the Cardano node CLI like the following: | ||
|
||
.. code:: haskell |
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.
So, what the directive below does is to include a chunk of an actual Haskell file that we compile. That contains the example. So could you add this example to that file, which will then make sure it keeps compiling! Basically we don't use ..code
if we can help it.
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.
Thanks for that. Didn't know how it worked.
Is that good?
@@ -71,7 +72,6 @@ library | |||
Plutus.V1.Ledger.DCert as Ledger.DCert, | |||
Plutus.V1.Ledger.Crypto as Ledger.Crypto, | |||
Plutus.V1.Ledger.Interval as Ledger.Interval, | |||
Plutus.V1.Ledger.Scripts as Ledger.Scripts, |
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.
Yeah, this makes sense. Maybe put a line comment here explaining that we manually re-do that module so we can include some extra instances.
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.
That good?
BTW, just noticed that there's a |
Good question! No, because some scripts are also minting policies. However, it does raise the question of whether we should have different envelope types for validators and minting policies... For now, just leave it as it is and let's think about it. |
aca315c
to
62faa76
Compare
62faa76
to
c3ce3f2
Compare
Add the ability to export serialised PLC programs with Cardano API envelopes.
Pre-submit checklist:
Pre-merge checklist: