-
Notifications
You must be signed in to change notification settings - Fork 58
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
fix(core): plutus integers are now decoded correctly from indefinite length array form #1491
Conversation
cc51d17
to
75cddcb
Compare
@@ -886,7 +886,7 @@ export class CborReader { | |||
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
|
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