algorand / algorand/pyteal

Expose a `debug` compile option

Open
#282 1 comment 1 reaction 0 assignees View on GitHub
community interest new-feature-request Team Scytale
Dominant language
Python
Stars
288
Forks
138
PR merge metrics
No merged PRs in 30d

Description

## 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:

```py
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.