rusk
rusk copied to clipboard
Add gas spent API
Summary
Implement an API to estimate the gas limit required for executing a smart contract. It will provide the gas spent for a given call, to efficiently set a limit.
Possible solution design or implementation
To calculate the gas spent for a given call, query_raw can be called through Rusk. By providing a contract_id
, fn_name
and fn_arg
, a non-persistent execution by the VM can be done.
This execution will return a receipt with the gas spent, which the API should return.