-
Notifications
You must be signed in to change notification settings - Fork 523
tools: Support logs and Inner transactions in tealdbg #3547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d#3237) * Three new globals for to help contract-to-contract usability * detritis * Check error * doc comments
* Three new globals for to help contract-to-contract usability * detritis * Check error * doc comments * opcode, docs, and tests * specs update
I think this issue addresses the step into: https://github.com/algorand/go-algorand-internal/issues/1789
Good point - I can try to address this in this PR 👍
I'll play around with this and see what works better - I initially moved it out because the sidebar looked a bit congested, but I think that's a fair point.
True, I'll play around with this as well - I will address this in this PR or create an issue to address this. |
jasonpaulos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The budget changes look great!
I have one last suggestion that should not matter practically, but it's probably a good idea
algorandskiy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last remark
jannotti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved (Pavel also had before the last commit removed it.)
Summary
This PR adds logs as an array and one layer of inner txns as an object in the local scope of
tealdbg. The logs are represented as a[]stringand inner txns as[]transactions.SignedTxnWithADinAppState. Currently this PR is based on thefeature/contract-to-contractbranch to support nested inner txns.Short explanation
makeLocalScope()is called and the logs/itxns array is created with their respective object IDs. The object IDs map tomakeLogsState()andmakeInnerTxnsState().innerTxnObjID_id_01_02_03denotess.innerTxn[1][2][3]by supplying an array of group IDs. For a single inner transaction, it uses theinnerTxnObjID_idprefix and for an array of nested inner transactions, it is encoded asinnerTxnObjID_nested.makeInnerTxnImpl(), build the transaction object and encode the log obj and array of nested inner transactions ID. If the ID is an array of inner transactions, then create a slice of inner transaction objects and encode each inner transaction object by appending the group ID.Test Plan
Visually checked output and updated test case. There is a script for generating a test transaction and debugging context here.

For any interested observers, there is an example test case with nested itxns you can run on the browser in this repo. You can do something like:
make installtealdbgfrom your GOPATH bin with the example dryrunmsgp, e.g../tealdbg debug path-to-test-repo/itxn_call2.teal -d path-to-test-repo/generated-data/dryrun_txn.msgp --group-index 5