PyTeal-to-TEAL mapping
Problem
It is difficult to debug PyTeal, because a user can typically only get errors reported at the TEAL line level (at best). Figuring out which PyTeal line corresponds to each TEAL line is currently a manual process.
Solution
Provide a PyTeal-to-TEAL mapping file that is generated when the PyTeal is compiled. This mapping should indicate which line(s) of PyTeal each line of TEAL came from (these are of course not 1-to-1).
FYI, this will be used to add to the trace created in https://github.com/algorand/go-algorand/issues/3953.
Hey. I am the author of tealer, a static analysis framework for Teal code.
If pyteal can provide a source code mapping to third party tools, we would love to add Pyteal <> Teal mapping within tealer. For example we could output the control flow graph of the teal code, and add the related pyteal source code, to ease the reading, and help developers to understand how the generated code works.
Would love this as well
he @pmprete this was completed and released!
See https://github.com/algorand/pyteal/blob/master/examples/application/sourcemap.py for an example