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

Use cardano-ledger for all minimum UTxO calculations #3456

Merged

Commits on Aug 25, 2022

  1. Configuration menu
    Copy the full SHA
    a846156 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a345f43 View commit details
    Browse the repository at this point in the history
  3. Add function computeMinimumCoinForUTxOCardanoApi.

    This function simply encapsulates the Cardano API minimum UTxO function
    in a wallet-friendly interface, acceping and returning wallet-friendly
    types.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    d014ad1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    58893a7 View commit details
    Browse the repository at this point in the history
  5. Make unsafeCoinFromCardanoApiCalculateMinimumUTxOResult an inner fu…

    …nction.
    
    This function is now only used by `computeMinimumCoinForUTxOCardanoApi`.
    
    We can safely make it an inner function.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    73bcc85 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8450f1d View commit details
    Browse the repository at this point in the history
  7. Add function computeMinimumCoinForUTxOCardanoLedger.

    This function simply encapsulates the Cardano Ledger minimum UTxO
    function in a wallet-friendly interface, acceping and returning
    wallet-friendly types.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    eef2937 View commit details
    Browse the repository at this point in the history
  8. Test that computeMinimumCoinForUTxO{CardanoApi,CardanoLedger} are e…

    …quivalent.
    
    We eventually wish to switch from the Cardano API implementation of the
    minimum UTXO calculaion to the Cardano Ledger implementation.
    
    But before we do that, we test that the implementations are equivalent.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    687ec15 View commit details
    Browse the repository at this point in the history
  9. Use computeMinimumCoinForUTxOCardanoLedger in implementation.

    This commit switches from the Cardano API implementation of the minimum
    UTxO calculation to the Cardano Ledger implementation.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    070fa91 View commit details
    Browse the repository at this point in the history
  10. Do not treat the Babbage era specially in the public implementation.

    Now that we are using the Cardano Ledger implementation of the minimum
    UTxO calculation, we no longer need to treat the Babbage era specially
    in our public implementation.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    b54ab99 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3b8469c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    85d4577 View commit details
    Browse the repository at this point in the history
  13. Delete redundant code from public MinimumUTxO module.

    These functions are no longer used.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    7d04155 View commit details
    Browse the repository at this point in the history
  14. Remove prop_computeMinimumCoinForUTxO_evaluation.

    Since our minimum UTxO calculation now relies on Cardano Ledger, we no
    longer need to convert from era-specific protocol parameters to the
    era-agnostic protocol parameters required by the Cardano API.
    
    Therefore, this property test (which checked that conversions would
    never cause run-time errors) is no longer necessary.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    0d964e4 View commit details
    Browse the repository at this point in the history
  15. Use underscores to make function names clearer.

    The juxtaposition of "UTxO" followed by another capitalised word is
    rather hard to read. This commit introduces underscores to aid
    readability.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    3b009d2 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    bd1f8e3 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    3b8f585 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    93b4405 View commit details
    Browse the repository at this point in the history
  19. Adjust signature of `prop_computeMinimumCoinForUTxO_CardanoApi_Cardan…

    …oLedger`.
    
    It's simpler for this property to accept a `TokenBundle` instead of a
    `TokenMap` and `Coin`.
    
    The `Arbitrary` instance for `TokenBundle` uses the `genTxOutTokenBundle`
    generator, which already has good coverage of minimum and maximum values
    specifically in the context of a transaction output.
    
    This allows us to get rid of the `Arbitrary` instance for `Coin` (which
    in hindsight would have been better to implement with the `genTxOutCoin`
    generator).
    
    In response to review feedback:
    
    #3456 (comment)
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    9f37edc View commit details
    Browse the repository at this point in the history
  20. Simplify type signatures of to{Alonzo,Babbage}TxOut.

    We can use the `Standard{Alonzo,Babbage}` synonyms for greater concision.
    jonathanknowles committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    3866692 View commit details
    Browse the repository at this point in the history