Skip to content

Empty List Using Indefinite Encoding #1318

Closed
@EzePze

Description

@EzePze

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions