bloxbean / yaci

A Cardano Mini Protocols implementation in Java
MIT License
22 stars 3 forks source link

Deserialization and serialization of redeemer is causing invalid cbor in some scenarios #37

Closed satran004 closed 8 months ago

satran004 commented 10 months ago

Yaci deserializes the redeemer from the witness, but then it serializes the redeemer back into CBOR hex to pass it to the consuming application. This process of serialization and deserialization is causing an invalid CBOR hex in the consuming application, in this case, Ledger Sync, for one transaction's redeemer on the preview network.

Although we need to determine why the deserialization → serialization → deserialization process fails in this case, I think we should send the already parsed fields to the consuming application, so it doesn't need to parse it again. This approach would also avoid the current error.

Solution:

Add other required fields to Yaci's Redeemer.java

    private RedeemerTag tag;
    private int index;
    private Datum data;
    private ExUnits exUnits;

https://github.com/cardano-foundation/cf-ledger-sync/issues/70