Open t1lde opened 3 years ago
@bezirg are you the best person to answer this question:
Meanwhile: what are our best options for debugging on-chain code currently? Would it be viable (if a bit painful) to use the CEK machine API?
? This issue is old, but that doesn't make the question any less important.
... meanwhile, we do now have a debugger and working on a better debugging experience is one of our objective and is something that we already do, hence I'm marking this issue with status: objective
.
Currently, debugging Validator code running on-chain is painful since there is no equivalent of
Show
which compiles to plutus core.For me, the debugging story has been:
Use traceIfFalse with a descriptive error on all boolean conditions of the Validator.
Look at the trace output given by failing tests to get a view of the TxInfo for the ScriptContext.
The above are good sometimes but when the time comes to properly trace execution, the picture is a lot worse. We end up having to insert conditional traceErrors and manually binary search to find out values...
In #3142, @ak3n mentioned Data may be a builtin in future, which might enable some better options.
Meanwhile: what are our best options for debugging on-chain code currently? Would it be viable (if a bit painful) to use the CEK machine API?