rusk icon indicating copy to clipboard operation
rusk copied to clipboard

Add gas spent API

Open HDauven opened this issue 1 year ago • 0 comments

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.

HDauven avatar Dec 22 '23 13:12 HDauven