-
Notifications
You must be signed in to change notification settings - Fork 63
fix(core): plutus integers are now decoded correctly from indefinite length array form #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cc51d17 to
75cddcb
Compare
| const { length: chunkLength, bytesRead } = CborReader.#peekDefiniteLength(nextInitialByte, data.slice(i)); | ||
| const payloadSize = bytesRead + Number(chunkLength); | ||
|
|
||
| concat = Buffer.concat([concat, this.#data.slice(i + (payloadSize - chunkLength), i + payloadSize)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥲
…length array form
75cddcb to
028f3f0
Compare
|
rhyslbw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good 👍
Context
There was a bug in the CborReader that would cause incorrect reading of cbor bytestings encoded in indefinite form if they were inside another CBOR element as the offset was not being taken into account.
The PlutusData was no chunking integers if their serialized form did not fit in the 64 bytes chunk limit.
Proposed Solution