-
Notifications
You must be signed in to change notification settings - Fork 213
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 estimateSignedTxSize
to separate module
#4037
Conversation
722509f
to
415aecc
Compare
415aecc
to
d7de4e0
Compare
d7de4e0
to
f8c829a
Compare
7b24f1f
to
16b3ce1
Compare
84f3987
to
b1b9471
Compare
estimateSignedTxSize | ||
|
||
, KeyWitnessCount (..) | ||
, estimateKeyWitnessCount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: the estimateSignedTxSize
and estimateKeyWitnessCount
functions seem like ideal candidates to place within the Balance.SizeEstimation
module, or a more general Balance.Estimation
module, given that estimateKeyWitnessCount
is not a size estimation, per se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did very much want estimateKeyWitnessCount
and signTx
next to each other. I'd suggest to revisit in another PR regardless.estimateSignedTx
might make sense in Write.Tx.SizeEstimation
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
estimateSignedTx might make sense in Write.Tx.SizeEstimation though
Actually — no. estimateSignedTx
is very different from the functions in the SizeEstimation
module. It:
- is used by balanceTransaction, not coin selection
- doesn't actually estimate anything itself, it takes the previously estimated
KeyWitnessCount
as an argument - is implemented using
evaluateMinimumFee
So it should perhaps be called evaluateSignedTxSize
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did very much want estimateKeyWitnessCount and signTx next to each other.
The reason being that they should match. Or technically:
signTx
must never add more witnesses thanestimateKeyWitnessCount
estimatedestimateKeyWitnessCount
should never overestimate when transactions contain no native scripts
Related: https://cardanofoundation.atlassian.net/browse/ADP-2675
e9786c2
to
668685b
Compare
7ebe419
to
46f6c93
Compare
Comments
estimateTxSize
etc to separate module #4036Issue Number
ADP-3081