Emulate Transaction
Last updated
Was this helpful?
Last updated
Was this helpful?
Emulate transaction execution locally to understand why it fails
If you want to test your contract locally and find out will your operation work on the real network or not, you can emulate it locally.
Core SDK provides method of tvm
module for it.
provides localDeploy
and localRun
functions for it.
To emulate deploy you need to create a deploy message and execute it locally.
If you plan to emulate local execution afterwards, then retrieve account state (BOC) from deploy emulation result and pass it into the next local execution.
See the JavaScript samples below to understand how to emulate contract deploy.
To emulate local execution you need to take the current contract state (boc), create a run message and execute it locally on the current account state.
If you emulated deploy before run, then you need to get the account state from the result of the deploy emulation.
For the subsequent call emulations, use account state retrieved from the previous local execution emulation.
See the JavaScript samples below to understand how to emulate contract deploy.
Core
AppKit