-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
Internal/External
Internal if an IOHK staff member.
Area
Other Any other topic (Delegation, Ranking, ...).
Describe the feature you'd like
Currently Plutus Script lang
serialisation uses double CBOR encoding. It serialises PlutusScript lang
:
serialiseToCBOR (PlutusScript PlutusScriptV1 s) = |
which stores already serialised script representation in CBOR. As a result, the TextEnvelope
JSON produced contains cborHex
which is doubly serialised.
This also makes decoding of Plutus scripts a two-stage process:
cardano-api/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs
Lines 283 to 290 in 9af6866
envelope <- | |
H.leftFailM $ | |
fmap (deserialiseFromJSON AsTextEnvelope) . H.evalIO $ | |
B.readFile "test/cardano-api-test/files/input/plutus/v3.alwaysTrue.json" | |
ScriptInAnyLang (PlutusScriptLanguage PlutusScriptV3) s@(PlutusScript PlutusScriptV3 script) <- | |
H.leftFail $ deserialiseFromTextEnvelopeAnyOf textEnvTypes envelope | |
let scriptLangInEra = case ceo of | |
ConwayEraOnwardsConway -> PlutusScriptV3InConway |
Firstly the envelope has to be decoded from JSON, and then the PlutusScript itself.
Acceptance criteria:
- The plutus scripts are singly encoded when writing
- The single encoded plutus script can be read by cardano-api
- The double-encoded plutus script can be read by cardano-api (a fallback when logic in AC2 fails)
Metadata
Metadata
Assignees
Labels
No labels