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

Simple and efficient way of accessing the datum and redeemer #6264

Open
effectfully opened this issue Jun 28, 2024 · 0 comments
Open

Simple and efficient way of accessing the datum and redeemer #6264

effectfully opened this issue Jun 28, 2024 · 0 comments

Comments

@effectfully
Copy link
Contributor

In #6247 @Unisay showed us how to access the datum and redeemer efficiently, but not simply. We could consider adding a dedicated data type for doing this lazy decoding (data JustGiveMeDatumAndRedeemer = <...>), so that unsafeFromBuiltinData does the right thing for it, however we actually probably don't need to, because once @ana-pantilie's work on backing ScriptContext by Data is done we'll probably be able to use the fields of ScriptContext directly (implemented as pattern synonyms, I assume)? Accessing both the datum and redeemer via fields is going to be less efficient than using a dedicated type though, because we'd have to skip the tx info twice for each of them for example, so maybe having a dedicated type is worth it in the end.

This issue is for figuring what interface we should provide for accessing the datum and redeemer, as well as implementing that interface.

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

No branches or pull requests

1 participant