-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: support estimating contract calls fees #361
Conversation
…tacks interface trait
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.
Looks good, but I'd like a response to the "max" question I put even if we choose not to do it. Then I'll approve.
To move us along I'm happy to approve this ticket, but we should make a TODO note above the |
Done in 0092844 |
Okay, I made this more robust in #368. |
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.
Lgtm. I agree that using the max fee is suboptimal, but not worth holding up this PR
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.
LGTM.
Description
Closes #233.
We need the current priority mempool fees for stacks transactions. This PR adds a function that uses the
POST /v2/fees/transaction
endpoint on stacks-core for this.All fees returned are the high-priority fee amount (not the fee rate). And the implementation for estimating fees in the trait falls back on the high-priority STX transfer fee in the event that the node cannot estimate fees for the transaction.
Changes
StacksInterface
trait for estimating fees, along with a "robust" implementation that falls back to the STX transfer fee estimate if the node does not know how much the particular transaction will cost.Testing
This PR adds an integration test that should work with both a pre- and -post-nakamoto stacks-node. It's not set up to run in CI.