post
https://api.shasta.trongrid.io/wallet/triggerconstantcontract
This interface is used for pre-execution (or simulation) of smart contracts on the blockchain: it can call a contract's read-only functions for data queries, call non-read-only functions to predict transaction success or estimate required Energy consumption
Note:
- TriggerConstantContract operation will not generate an on-chain transaction, nor will it change the status of the current node.
Returns
| Field | Type | Description |
|---|---|---|
| result | Return | Run result, for detailed parameter definition, refer to EstimateEnergy |
| energy_used | int64 | Total energy consumption, including basic and penalty energy consumption. |
| energy_penalty | int64 | Penalty Energy consumption. |
| constant_result | string[] | List of results from a constant contract call. |
| transaction | Transaction | Transaction object, see GetTransactionByID for structure. |
Conclusion:
- The energy consumption:
energy_used - The penalty energy consumption:
energy_penalty - The basic energy consumption:
energy_used-energy_penalty