Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CBR-462] Fix 0 fee transaction #3704

Merged
merged 2 commits into from
Oct 4, 2018

Commits on Oct 3, 2018

  1. [CBR-462] Fix fee estimation when transaction's amount matches accoun…

    …t's balance
    
    When calling
    
    ```
    reduceChangeOutputs
      :: forall dom. CoinSelDom dom
      => Fee dom
      -> [Value dom]
      -> ([Value dom], Fee dom)
    ```
    
    If the `[Value dom]` is a singleton array with a zero coin, we're going
    to end up dividing by zero and silently obliterating fee as we do it.
    This happens when making a transaction with no change, i.e., when the
    transaction's amount matches exactly the source account's balance.
    
    This commit provides a fix handling this special edge-case.
    KtorZ committed Oct 3, 2018
    Configuration menu
    Copy the full SHA
    78c113e View commit details
    Browse the repository at this point in the history
  2. [CBR-462] Throws right error when running out of UTxO in fee calculation

    In this context, @CoinSelHardErrUtxoDepleted@ might be thrown by
    `pickUtxo` as we iterate over the selected change outputs which here
    means that we are running out of UTxOs to cover the fee.  Hence, we
    ought to remap the error accordingly to @CoinSelHardErrCannotCoverFee@.
    KtorZ committed Oct 3, 2018
    Configuration menu
    Copy the full SHA
    527afc7 View commit details
    Browse the repository at this point in the history