cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.MinAda

Description

This module provides functions to ensure skeleton outputs contain enough ada to satisfy the minimum ada constraint.

Synopsis

Documentation

toTxSkelOutWithMinAda Source #

Arguments

:: MonadBlockChainBalancing m 
=> TxSkelOut

The output to potential adjust

-> m TxSkelOut

Returns Nothing when no ajustment was required/done, and Just(newOutput,newAdaAmount) otherwise.

This transforms an output into another output which necessarily contains at least the minimal required ada. If the previous quantity of ada was sufficient, it remains unchanged.

toTxSkelWithMinAda :: MonadBlockChainBalancing m => TxSkel -> m TxSkel 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.

getTxSkelOutMinAda :: MonadBlockChainBalancing m => TxSkelOut -> m Integer Source #

Compute the required minimal ADA for a given output