cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Automation.AutoFilling.MinAda

Description

This module exposes functions to automatically adjust the ADA contained in the outputs of a TxSkel to satisfy the minimal amount required by the protocol parameters.

Synopsis

Documentation

getTxSkelOutMinAda :: Members '[MockChainRead, Error ToCardanoError] effs => TxSkelOut -> Sem effs Integer Source #

Compute the required minimal ADA for a given output

toTxSkelOutWithMinAda :: forall effs. Members '[MockChainRead, MockChainLog, Error ToCardanoError] effs => TxSkelOut -> Sem effs TxSkelOut Source #

This transforms an output into another output which contains the minimal required ada. If the previous quantity of ADA was sufficient, it remains unchanged. This can require a few iterations to converge, as the added ADA will increase the size of the UTXO which in turn might need more ADA.

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

This goes through all the TxSkelOuts of the given skeleton and updates their ada value when requested by the user and required by the protocol parameters. Logs an event whenever such a change occurs.