Closed
Description
Summary
When constructing an empty PlutusList
, calling toCbor
serialises it with indefinite encoding, which is not canonical and can cause problems with scripts, particularly the serialise
builtin.
Steps to reproduce the bug
console.log((new PlutusList()).toCbor())
console.log(PlutusList.fromCbor(HexBlob("80")).toCbor())
Actual Result
9fff
9fff
Which is the encoding for an indefinite list
Expected Result
80
80
Which is the encoding for a definite list
SDK version
0.30.2
Environment type
- Node.js
- Browser
- Browser Extension
- Other
Environment details
No response