-
Notifications
You must be signed in to change notification settings - Fork 126
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
Reference script to_bytes() includes tag 24 cbor wrapper #669
Comments
Hi @Scitz0 ! If I understand you correctly you need to have original plutus script bytes of inlined script, right ? |
@lisicky incorrect :) We need to pass along bytes (in hex) including the "type" plutus vs native that I assume the first two bytes represent. |
Okay here script_ref CDDL and you need just CBOR of script part of it ? |
Correct, so bytes of entire |
@Scitz0 if it is not urgent I guess we can add it in next two weeks |
You can also decode cbor via https://cardananium.github.io/cquisitor/ , it is more user friendly in some cases |
Its not urgent no, just good to have option to get bytes this way in a future version. For now we solved it by utilizing another cbor lib to extract the bytes. |
Sorry @Scitz0 for delay. |
Ok great, I will leave on a two week vacation shortly so bad timing. Though I'm sure its working properly. |
Implemented in the CSL 12.0.0 |
When creating the json request to pass along to Ledger and Trezor hardware wallets we use CSL to deserialize the transaction cbor. For reference scripts in outputs, we noticed that when calling
output.script_ref().to_bytes()
it included the tag 24 cbor wrapper (not sure of proper nomenclature), ied8 18
(tag(24)) +59 04db
(bytes(1243)) as in below example cbor. I didn't find a way to access the actual bytes of the value (82025904d...
) for the reference script using CSL.In comparison with inline datum in same example, defined as
[ 0, $hash32 // 1, data ]
wheredata = #6.24(bytes .cbor plutus_data)
in CDDL.When we access the inline datum using
output.plutus_data().to_bytes()
we only get the actual value d87980, not the additional tag(24) and byte count.Privously I have noticed that there was two functions available,
to_bytes()
andas_bytes()
with the latter returning wrapping code and former didn't (could be misremembering). For reference script, I can only see the to_bytes() function while for inline datum both are present. Could the same behavior be replicated for reference script as for inline datum?Example cbor:
Using CSL 12 alpha 22
The text was updated successfully, but these errors were encountered: