Skip to content

Commit

Permalink
Update comment for performSelection to reflect the failure case.
Browse files Browse the repository at this point in the history
We now have a pair of post conditions:

- For the case where creation of a selection succeeds.
- For the case where creation of a selection fails.
  • Loading branch information
jonathanknowles committed Oct 14, 2021
1 parent c3e6bd4 commit 5bdb57b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/core/src/Cardano/Wallet/Primitive/CoinSelection.hs
Expand Up @@ -155,11 +155,18 @@ type PerformSelection m a =
-- - producing change outputs to return excess value to the wallet;
-- - balancing a selection to pay for the transaction fee.
--
-- This function guarantees that if it successfully creates a 'Selection' @s@,
-- given a set of 'SelectionConstraints' @cs@ and 'SelectionParameters' @ps@,
-- then the following property will hold:
-- This function guarantees that given a set of 'SelectionConstraints' @cs@
-- and 'SelectionParams' @ps@:
--
-- >>> verifySelection cs ps s == VerifySelectionSuccess
-- - if creation of a selection succeeds, a value @s@ of type 'Selection'
-- will be returned for which the following property holds:
--
-- >>> verifySelection cs ps s == VerifySelectionSuccess
--
-- - if creation of a selection fails, a value @e@ of type 'SelectionError'
-- will be returned for which the following property holds:
--
-- >>> verifySelectionError cs ps e == VerifySelectionErrorSuccess
--
performSelection
:: (HasCallStack, MonadRandom m) => PerformSelection m Selection
Expand Down

0 comments on commit 5bdb57b

Please sign in to comment.