-
Notifications
You must be signed in to change notification settings - Fork 148
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
Return hbar fee / gas used on failed smart contract execution #1612
Comments
Here's the dump of the error object on smart contract call revert/require trigger
|
Hello @iron4548, and thank you for the issue.
|
@iron4548 I will close the issue? |
@ochikov yes you may. "I've requested the core team if it's possible to be added and they will consider it" - can this be tracked elsewhere? |
Hello @iron4548, I've researched more deeply the issue and there is a way to get it through the SDK because the consensus node is returning that information. We are going to provide such kind of functionality with the new version. I will tag you here when we are ready. |
Description
I use
ContractExecuteTransaction
and on a successful call, I can get the hbar fee / gas used value viacontractExecuteRec.transactionFee
. However, if the smart contract call failed due to a revert or due to a require, it will throw an error (unsure if this is by design or not). Within the error there are a bunch of records but none of them contains the hbar fee / gas used value. The failed transaction can be queried via mirror node to get the fee. The question is - is it possible to get the hbar fee / gas used value on a failed/reverted smart contract call so that I don't need to query the mirror node for it?Steps to reproduce
Use @hashgraph/sdk 2.24.2
Additional context
No response
Hedera network
mainnet
Version
2.24.2
Operating system
None
The text was updated successfully, but these errors were encountered: