Skip to content

Commit

Permalink
Add comment to minimizeFee in TransactionLayer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Apr 19, 2022
1 parent b70aece commit 85f1a06
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/core/src/Cardano/Wallet/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,25 @@ data TransactionLayer k tx = TransactionLayer
, minimizeFee
:: FeePolicy
-> Coin
-- ^ Surplus to distribute
-- ^ Surplus transaction balance to distribute.
-> TxFeeAndChange [TxOut]
-- ^ Fee and change outputs
-- ^ Original fee and change outputs.
-> Either ErrMoreSurplusNeeded (TxFeeAndChange [TxOut])
-- ^ Adjusted fee and change outputs.
--
-- Distributes a surplus transaction balance between the given change
-- outputs and the given fee. This function is aware of the fact that
-- any increase in a 'Coin' value could increase the size and fee
-- requirement of a transaction.
--
-- When comparing the original fee and change outputs to the adjusted
-- fee and change outputs, this function guarantees that:
--
-- - The number of the change outputs remains constant;
-- - The fee quantity either remains the same or increases.
-- - For each change output:
-- - the ada quantity either remains constant or increases.
-- - non-ada quantities remain the same.

, computeSelectionLimit
:: ProtocolParameters
Expand Down

0 comments on commit 85f1a06

Please sign in to comment.