cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Automation.AutoFilling.ReferenceScripts

Description

This module exposes functions to automatically attach reference inputs carrying reference scripts to the redeemers of a TxSkel, based on the current state of the blockchain.

Synopsis

Documentation

updateRedeemedScript :: Members '[MockChainLog, MockChainRead] effs => [TxOutRef] -> User IsScript Redemption -> Sem effs (User IsScript Redemption) Source #

Attempts to find in the index a utxo containing a reference script with the given script hash, and attaches it to a redeemer when it does not yet have a reference input and when it is allowed, in which case an event is logged.

autoFillReferenceScripts :: Members '[Tweak, MockChainRead, MockChainLog] effs => Sem effs () Source #

Goes through the various parts of the skeleton where a redeemer can appear, and attempts to attach a reference input to each of them, whenever it is allowed and one has not already been set. Logs an event whenever such an addition occurs.