cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.GenerateTx.Collateral

Description

This module exposes the generation of transaction collaterals, which consist of a collateral amount, collateral inputs and return collateral

Synopsis

Documentation

toCollateralTriplet :: Members '[MockChainRead, Error ToCardanoError] effs => Maybe Collaterals -> Sem effs (TxInsCollateral ConwayEra, TxTotalCollateral ConwayEra, TxReturnCollateral CtxTx ConwayEra) Source #

Computes the collateral triplet from the potential collaterals. What we call a collateral triplet is composed of:

  • The set of collateral inputs
  • The total collateral paid by the transaction in case of phase 2 failure
  • An output returning excess collateral value when collaterals are used

These quantity should satisfy the equation (in terms of their values): collateral inputs = total collateral + return collateral