Update big-arg
fixtures after CSL is replaced by CDL
#1673
Closed
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.
This should be merged after (or together) with the WIP branch authored by @marcusbfs that will replace CSL with CDL. I am opening a separate PR for the fixtures update so that it can be evaluated separately why these changes are necessary.
Why is this change necessary
CDL is meant to be a drop-in replacement for CSL, but that doesn't mean its serializing behaviour is exactly the same. In some scenarios, CDL will output CBOR that is slightly different to the one produced by CSL. The reason is that CDL has other (equally valid) defaults when creating certain transaction components.
This doesn't mean that CDL is incompatible with CSL. In particular, CDL guarantees that
cbor == cdl.serialize(cdl.deserialize(cbor))
for all CBOR, even for CBOR that was created by another library (the "roundtrip" property). The differences in encoding are seen when the component that is to be serialized is created from scratch using one of CDL's classes, since CDL does not promise to emulate the behavour of CSL's constructors. Example:cdl.TransactionWitnessSet.new(...).to_hex() != csl.TransactionWitnessSet.new(...).to_hex()
.The specific change in the
big_arg
fixturesIn the
Test.Ctl.ApplyArgs
module a set of different arguments is applied to a variety of scripts. One of these arguments, calledbig_arg
, has changed its encoding with the CDL update. Specifically, the CBOR arrays contained inside the PlutusData now have a definite length encoding vs the indefinite length encoding used before (CBOR spec on this topic).New big-arg
Old big-arg:
(Notice the underscore after the initial square bracket (
[ _ ...
) - this is syntax for indefinite length arrays)When applying the new encoding of
big-arg
to the same scripts, we obtain very similar applied scripts with:This can be seen if we inspect the diff of an applied script with respect to
master
:Git diff
First we see a change in length for the first two bytearray headers (
58ff58fd
becomes59010158ff
) followed by a change in thebig-arg
that is stored within the script itself. All updated fixtures contain essentially the same changes.Pre-review checklist
make format
)templates/ctl-scaffold
) has been updated## Unreleased
header, using the appropriate sub-headings (### Added
,### Changed
,### Removed
,### Fixed
), and the links to the appropriate issues/PRs have been included