Repository navigation
feat(datum): write new inline datums with the plutusData codec options - #618
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new inline datum was written with
Data.DEFAULT_CBOR_OPTIONSwhatever options the caller passed to the transaction encoder. Since #610, witness datums and redeemer data followCBOR.TxCodecOptions.plutusData, so withCBOR.TX_CANONICAL_OPTIONSor a customplutusDatathe inline datums in the same transaction used a different layout from the rest of its Plutus data, and there was no way to write them in another layout.The options now reach
DatumOptionthroughTransactionBody,TxOutandTransactionOutput, whose encoders and schemas takeCBOR.TxCodecOptionslike the witness set modules, and a new inline datum is written withplutusData.DatumOption.makeFromCDDLandTxOut.makeFromCDDLbuild the CDDL schema for given Plutus data options;FromCDDLin each module keeps its type and behavior. With no options,CBOR.TX_DEFAULT_OPTIONSorCBOR.CML_DEFAULT_OPTIONS, every byte stays the same. Under other options only the bytes inside tag 24 change. A decoded inline datum keeps its original bytes, and one added to a decoded transaction is written with the default options.Closes #611