cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Balancing

Description

This module handles auto-balancing of transaction skeleton. This includes computation of fees and collaterals because their computation cannot be separated from the balancing.

Synopsis

Documentation

balanceTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Maybe (Collaterals, Wallet)) Source #

This is the main entry point of our balancing mechanism. This function takes a skeleton and returns a (possibly) balanced skeleton alongside the associated fee, collateral inputs and return collateral wallet, which might be empty when no script is involved in the transaction. The options from the skeleton control whether it should be balanced, and how to compute its associated elements.

getMinAndMaxFee :: MonadBlockChainBalancing m => m (Fee, Fee) Source #

This computes the minimum and maximum possible fee a transaction can cost based on the current protocol parameters