-
Notifications
You must be signed in to change notification settings - Fork 463
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
tools: Support logs and Inner transactions in tealdbg #3547
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. |
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
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
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[]string
and inner txns as[]transactions.SignedTxnWithAD
inAppState
. Currently this PR is based on thefeature/contract-to-contract
branch 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_03
denotess.innerTxn[1][2][3]
by supplying an array of group IDs. For a single inner transaction, it uses theinnerTxnObjID_id
prefix 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.
![Screen Shot 2022-02-03 at 10 44 58 PM](https://user-images.githubusercontent.com/86622919/152468510-0862956b-a12f-49f8-89a0-fbc5b261861d.png)
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 install
tealdbg
from 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