-
-
Notifications
You must be signed in to change notification settings - Fork 200
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: Add gasLimitNoBuffer
to transactionMeta
#5113
base: main
Are you sure you want to change the base?
Conversation
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
estimatedGas
to transactionMeta
gasLimitNoBuffer
to transactionMeta
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@@ -170,7 +171,7 @@ async function getGas( | |||
bufferMultiplier, | |||
); | |||
|
|||
return [bufferedGas, simulationFails]; | |||
return [bufferedGas, simulationFails, estimatedGas]; |
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.
Currently this is only being persisted if we actually do an eth_estimateGas
but is it simpler to always save a value so the UI can always use it directly even if fixed or provided by the dApp?
@@ -184,6 +184,11 @@ type TransactionMetaBase = { | |||
/** Whether the gas fee estimates have been checked at least once. */ | |||
gasFeeEstimatesLoaded?: boolean; | |||
|
|||
/** | |||
* The estimated gas for the transaction without buffer. |
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.
* The estimated gas for the transaction without buffer. | |
* The estimated gas for the transaction without any buffer applied. |
### Added | ||
|
||
- Add `gasLimitNoBuffer` property to `TransactionMeta` type ([#5113](https://github.com/MetaMask/core/pull/5113)) | ||
- `gasLimitNoBuffer` is the estimated gas (via `eth_estimateGas`) for the transaction without buffer. |
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.
- `gasLimitNoBuffer` is the estimated gas (via `eth_estimateGas`) for the transaction without buffer. | |
- `gasLimitNoBuffer` is the estimated gas for the transaction without any buffer applied. |
Explanation
This PR aims to add
gasLimitNoBuffer
totransactionMeta
to show minimum value while calculating network fee.References
Changelog
@metamask/transaction-controller
gasLimitNoBuffer
totransactionMeta
gasLimitNoBuffer
is the estimated gas (viaeth_estimateGas
) for the transaction without buffer.Checklist