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

Move definition of txConstraints to cardano-wallet. #4163

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Oct 17, 2023

Issue

ADP-3185

Description

This PR moves the definition of function txConstraints back to cardano-wallet.

The txConstraints function and TxConstraints type:

  • are part of the transaction size and cost abstraction used by the wallet's balance migration algorithm (which is completely separate from the UTxO selection algorithm used by balanceTransaction);
  • are only used by the wallet's balance migration algorithm;
  • are not used at all within the cardano-balance-tx library.

So we can safely move the txConstraints function away from cardano-balance-tx.

This is consistent with our goal of minimising the public interface of cardano-balance-tx.

Notes

An alternative approach to this PR would be to move txConstraints to the Internal module hierarchy of cardano-balance-tx, and then have cardano-wallet depend on the Internal module hierarchy. However, depending on an internal module seems unnecessary when we can just move this function to the only package that depends on it.

This function:
- is not needed anywhere in `cardano-balance-tx`;
- is only needed by the wallet's balance migration algorithm.
This value is already available in the scope of the outer function.
@jonathanknowles jonathanknowles changed the title Move definition of txConstraints back to cardano-wallet. Move definition of txConstraints to cardano-wallet. Oct 17, 2023
These functions are not used anywhere in `cardano-balance-tx`.
@@ -36,10 +35,8 @@ module Cardano.Write.Tx.SizeEstimation

-- * Needed for estimateSignedTxSize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section title doesn't apply to the new sizeOf_VKeyWitnesses and sizeOf_Withdrawals

@jonathanknowles jonathanknowles added this pull request to the merge queue Oct 17, 2023
Merged via the queue into master with commit 6a7df14 Oct 17, 2023
2 checks passed
@jonathanknowles jonathanknowles deleted the jonathanknowles/move-txConstraints branch October 17, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants