-
Notifications
You must be signed in to change notification settings - Fork 23
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
[BUG] - Error when JSON encoding/decoding TxOut
from preprod
#612
Comments
Hi @koslambrou, thanks a lot for the reported issue and your PR fixing it. Our application code is also affected by this issue, specifically because we're still supporting some contracts using Plutus V1 with datum hash. |
@infrmtcs This issue is not related to the PR you mentioned, it is a different problem. Also, thanks for pointing out the |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days. |
This issue was closed because it has been stalled for 120 days with no activity. Remove stale label or comment or this will be closed in 60 days. |
Internal/External
Internal
Summary
Probable bug on
9.1
, andmain
.We are indexing the JSON representation of
TxOut
in a database. However, the encoding/decoding fails for someTxOut
that have inline datum inside it.After JSON encoding a
TxOut
encountered in Preprod, we get the following error after trying to decode it:Then, I inspected the CBOR representation of the inline datum before and after JSON serialization.
Before JSON serialization, for some
txOut
, doing:returned
"\216y\159\216y\159\SOH\161\216y\159\216y\159X\FS\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#E\255\216z\159\255\255\NUL\SOH\SOH\SOH\164\SOH\216y\159\SOH\SOH\255\STX\216y\159\STX\STX\255\ETX\216y\159\ETX\ETX\255\EOT\216y\159\EOT\EOT\255\255\255"
Then, doing:
returned
"\216y\159\216y\159\SOH\161\216y\159\216y\159X\FS\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#Eg\137\SOH#E\255\216z\128\255\NUL\SOH\SOH\SOH\164\SOH\216y\159\SOH\SOH\255\STX\216y\159\STX\STX\255\ETX\216y\159\ETX\ETX\255\EOT\216y\159\EOT\EOT\255\255\255"
In short, the returned CBOR representations are different.
Seems like we lose information when serializing to JSON.
The text was updated successfully, but these errors were encountered: