Skip to content

feat(datum): write new inline datums with the plutusData codec options - #618

Merged
solidsnakedev merged 4 commits into
mainfrom
feat/inline-datum-codec-options
Oct 9, 2026
Merged

solidsnakedev merged 4 commits into
mainfrom
feat/inline-datum-codec-options

Conversation

@solidsnakedev

Copy link
Copy Markdown
Collaborator

A new inline datum was written with Data.DEFAULT_CBOR_OPTIONS whatever options the caller passed to the transaction encoder. Since #610, witness datums and redeemer data follow CBOR.TxCodecOptions.plutusData, so with CBOR.TX_CANONICAL_OPTIONS or a custom plutusData the 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 DatumOption through TransactionBody, TxOut and TransactionOutput, whose encoders and schemas take CBOR.TxCodecOptions like the witness set modules, and a new inline datum is written with plutusData. DatumOption.makeFromCDDL and TxOut.makeFromCDDL build the CDDL schema for given Plutus data options; FromCDDL in each module keeps its type and behavior. With no options, CBOR.TX_DEFAULT_OPTIONS or CBOR.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

@solidsnakedev
solidsnakedev merged commit 4e748e6 into main Oct 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline datums should follow TxCodecOptions.plutusData

1 participant