How to find error line number in PyTEAL/TEAL? (developer experience)

When you send a transaction (i.e. a Payment transaction signed by escrow logic), you receive an error message back from the node saying something like: “assertion error pc=32”

The problem is, I cannot easily figure out where pc=32 corresponds to in my TEAL code. Whatsmore, finding where in my PyTEAL code is doubly inconvenient.

I have briefly tried tealdbg (skimmed), but I do not think I want to skip through an entire scenario to find the source of my bug. It also doesn’t seem to fit in so well with PyTEAL.

I was wondering what solutions exist for the developer experience?

Tealdbg is pretty simple to use but you can also do a dryrun using goal like
./goal clerk dryrun -t signed.tx
Where signed.tx is the outputted signed transaction or group of transactions.

1 Like