Repository navigation
feat(builder): spend datum hash outputs - #707
Merged
Merged
Conversation
The witness set and the script data hash write a datum's recorded bytes ahead of the plutusData options, and the witness set keeps each datum as the same object.
collectFrom takes a datums field and build takes onMissingDatum. The builder checks the spent datum hash inputs against the datums before coin selection and again at assembly, and the fake witness set counts them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spending an output that holds a datum hash at a Plutus script address failed. The builder left the datum out of the witness set, so the node rejected the transaction with a missing datum. A datum from
getDatumalso lost the bytes it was fetched with, so writing it with the build's codec options could change its hash.collectFromnow takes the datums of those inputs in adatumsfield, andbuild({ onMissingDatum: "provider" })fetches the missing ones withprovider.getDatum. The builder matches each datum to its input by hashing the bytes it will write. Before coin selection, the build fails when an input's datum is missing or a given datum belongs to no spent input. The default,onMissingDatum: "error", makes no request.The built-in
getDatumrecords the fetched bytes withOriginalBytes. The witness set and the script data hash write those bytes ahead of the codec options, as inline datums already do. The witness set keeps each datum as the same object, so the bytes survive the witness setsSignBuilderrebuilds. The fake witness set counts the datums toward the fee, andassemblekeeps only the transaction's own datums.Closes #698