IntersectMBO / IntersectMBO/plutus

Simple and efficient way of accessing the datum and redeemer

Open
#6,264 0 comments 0 reactions 0 assignees View on GitHub
Internal Plinth status: triaged
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

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](https://github.com/IntersectMBO/plutus/issues/5928) 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.