fix: added energy and bandwidth in transaction confirmation dialog from a dApp#355
Open
gabrieledm wants to merge 6 commits into
Open
Conversation
37cff26 to
e88cf2d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e88cf2d. Configure here.
…s-inaccurate-and-incomplete
…s-inaccurate-and-incomplete
4 tasks
| "jobs": [ | ||
| { | ||
| "duration": "PT60S", | ||
| "duration": "PT30S", |
Contributor
There was a problem hiding this comment.
This is a regression. We want the value to be PT60S as per latest PRs
Contributor
Author
There was a problem hiding this comment.
Sorry about this regression.
Pushing the restored value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
This PR fixes Tron dApp transaction confirmations so fee/resource information and balance validation are more accurate.
Insufficient fundsbanner when the account cannot cover the transaction value plus fees.getTransactionTrxValuehelper to extract native TRX value from:TransferContract.amountTriggerSmartContract.call_valueisInsufficientBalance.References
Before
Send
Swap
dApp - Enough funds
dApp - Insufficient funds
After
Send
Swap
dApp - Enough funds
dApp - Insufficient funds
Checklist
Note
Medium Risk
Changes the transaction signing confirmation gate and fee display for dApp flows; incorrect balance or fee logic could wrongly allow or block signatures.
Overview
Improves dApp transaction confirmations by showing the full estimated energy and bandwidth the transaction will use, even when those resources are covered by staked/free balances. TRX fee math is unchanged—users still pay TRX only for resource shortfalls.
Adds insufficient-funds protection on the confirmation screen: native TRX sent with the tx (
TransferContract/TriggerSmartContractcall_value) plus estimated TRX fees are compared to the account’s TRX balance. When balance is too low, an Insufficient funds banner appears and Confirm stays disabled.Supporting updates include
getTransactionTrxValue,isInsufficientBalanceon confirmation context, fee-calculator test expectations, and changelog/coverage/manifest shasum tweaks.Reviewed by Cursor Bugbot for commit 7201ce3. Bugbot is set up for automated code reviews on this repo. Configure here.