-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: allow passing gasPrice
to getTransactionCost
#3608
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Later, we should ask them why getTransactionCost
is being called on their side.
The primary purpose of getTransactionCost
is to calculate the script gas used. Changes related to the transaction fee, such as adding more UTXOs or adjusting the tip, do not modify the script gas used. As a result, there’s no need to rerun this method when they already have the gasUsed
, which would otherwise trigger at least another dry-run unnecessarily.
@Torres-ssf I will make a note for when I'm going to try implement this there, but one issue is that the wallet is not aware of the state of the transaction on load. It doesn't know whether it has the correct Still, there may be a smarter way to handle this, I'll have a think. |
Coverage Report:
Changed Files:
|
Release notes
In this release, we:
gasPrice
togetTransactionCost
functions to reduce possible network callsSummary
In the Fuel Wallet, a user can set a custom gas limit or tip for a transaction. It then checks if that changes the fee. If it has, it will re-estimate and fund the transaction.
This leads to two gas price fetches. One in the initial fee calculation, and one in the re-estimation.
By allowing the
getTransactionCost
to take agasPrice
parameter, we can reduce the number of network calls for this flow.The expected flow could then look like so:
Checklist