Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse balance transaction in construct transaction #3553

Commits on Nov 21, 2022

  1. generalize balanceTransaction

    paweljakubas authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    bb13c9d View commit details
    Browse the repository at this point in the history
  2. add preselection

    paweljakubas authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    f518541 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    10b7ad2 View commit details
    Browse the repository at this point in the history
  4. refactor: constructTransaction

    paweljakubas authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    de2b3c1 View commit details
    Browse the repository at this point in the history
  5. introduce dummyInput

    paweljakubas authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    71fa11b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5d45589 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    530b0d6 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c843c06 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7e70871 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    aa61a6d View commit details
    Browse the repository at this point in the history
  11. Fix imports.

    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    19101f5 View commit details
    Browse the repository at this point in the history
  12. Miscellaneous formatting fixes.

    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    1001601 View commit details
    Browse the repository at this point in the history
  13. Make inner functions of constructTransaction more concise.

    Use `LambdaCase` instead of repeating patterns.
    Use `Coin.fromQuantity` instead of `fromIntegral`.
    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    45e344f View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    d32f3b6 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    34fcc5e View commit details
    Browse the repository at this point in the history
  16. Match all cases in function removeDummyInput.

    This removes the incomplete pattern match warnings.
    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    e5d9c95 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    4bdee5a View commit details
    Browse the repository at this point in the history
  18. Simplify type of Cardano.Wallet.constructTransaction.

    The function `Cardano.Wallet.constructTransaction` is only ever called
    with a `Left PreSelection`, and never called with a `Right Selection`.
    
    Therefore, we can simplify the selection argument type from
    `Either PreSelection Selection` to just `PreSelection`.
    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    20fa2ff View commit details
    Browse the repository at this point in the history
  19. Move type PreSelection to Cardano.Wallet.Transaction.

    This helper type is only used by the `constructTransaction` and
    `mkUnsignedTx` functions, and not used by anything within the
    `CoinSelection` module hierarchy.
    jonathanknowles authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    cd4314f View commit details
    Browse the repository at this point in the history
  20. Tweak retrospective computation of change & outs

    Without this change integration tests would fail e.g. where:
    
    ```pseudo-code
    constructTx
      paymentTo addr1 (0 ada)
    
      |
      |
      V
    
    Tx
      output: addr1 (1 ada) -- min ada, set automatically
      output: addr2 (9 ada) -- change
    ```
    
    as we'd believe both outputs in the resuling tx were change -- neither
    of them exists in the original output list.
    
    If there are 'n' outputs in the original unbalanced tx, we will with
    this commit instead judge that the first 'n' are "outputs" and that the
    ones after that are all change. While this makes assumptions about how
    balanceTx appends outputs, it is more importantly ressilient to outputs
    being modified, like with the `increaseZeroAdaOutputs` feature.
    Anviking authored and Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    d41e258 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8be3361 View commit details
    Browse the repository at this point in the history
  22. chore: code formatting

    Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    ba55d2c View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    ddaabb9 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    d5b73df View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    9685c5c View commit details
    Browse the repository at this point in the history
  26. Safer dummy input removal

    Unisay committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    96c467b View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    6473ee4 View commit details
    Browse the repository at this point in the history