Skip to content
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

Question: Redeemers as map #693

Open
MarcelKlammer opened this issue Sep 19, 2024 · 2 comments
Open

Question: Redeemers as map #693

MarcelKlammer opened this issue Sep 19, 2024 · 2 comments

Comments

@MarcelKlammer
Copy link
Contributor

What's the currently handling for Redeemer maps in CSL?
Currently the lib only has array style APIs.

; Flat Array support is included for backwards compatibility and will be removed in the next era.
; It is recommended for tools to adopt using a Map instead of Array going forward.
redeemers = [+ [tag : redeemer_tag, index : uint .size 4, data : plutus_data, ex_units : ex_units]]
             / {+ [tag : redeemer_tag, index : uint .size 4] => [data : plutus_data, ex_units : ex_units]}
@lisicky
Copy link
Contributor

lisicky commented Sep 20, 2024

Hi @MarcelKlammer! We support it for serialization round-trip, the api to force using a map is not public now. But we will probably open it in the next version and force using a map structure by default.
But anyway the array format is still legal for the protocol and third-party tooling should support it.

@lisicky
Copy link
Contributor

lisicky commented Sep 23, 2024

Also, if you have issue with signing a transaction by CSL you can these functions in FixedTransaction structure.

.sign_and_add_vkey_signature()
.sign_and_add_icarus_bootstrap_signature()
.sign_and_add_daedalus_bootstrap_signature()
.add_vkey_witness()
.add_bootstrap_witness()

FixedTransaction preserves tx body, and all witnesses expect signatures as is, that helps to avoid incorrect tx hash and script integrity hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants