pyteal
pyteal copied to clipboard
Expose a `debug` compile option
Problem
It is difficult to map the pc returned from a failed transaction back to the PyTeal source line that caused it.
Solution
Add a debug: bool flag to the compile options and, if set to True, Assert should return something like:
return Assert(And(thing_being_asserted, Int(currentframe().f_back.f_lineno)))
This allows the small 3 line stack of the failing program to contain the python source line number.
Other possible debug flag changes might include adding comments to the source teal for source file names or line numbers.
A first attempt by Zeph here: https://github.com/algorand/pyteal/pull/650, we are making src-mapper more performant