Skip to content

Commit

Permalink
Proper error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpaulos committed Nov 8, 2023
1 parent 9324950 commit 4d72322
Show file tree
Hide file tree
Showing 25 changed files with 1,243 additions and 50 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/ahangsu/vscode-teal-debug.git"
"url": "https://github.com/algorand/teal-debugger.git"
},
"bugs": {
"url": "https://github.com/ahangsu/vscode-teal-debug/issues"
"url": "https://github.com/algorand/teal-debugger/issues"
},
"scripts": {
"compile": "tsc -p ./",
Expand Down
3 changes: 3 additions & 0 deletions sampleWorkspace/errors/app/fail.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma version 9
int 0
return
1 change: 1 addition & 0 deletions sampleWorkspace/errors/app/fail.teal.tok.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions sampleWorkspace/errors/app/lsig.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma version 9
txn Fee
!
txn RekeyTo
global ZeroAddress
==
&&
1 change: 1 addition & 0 deletions sampleWorkspace/errors/app/lsig.teal.tok.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

151 changes: 151 additions & 0 deletions sampleWorkspace/errors/app/simulate-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"initial-states": {},
"last-round": 6,
"txn-groups": [
{
"app-budget-added": 700,
"app-budget-consumed": 2,
"failed-at": [
1
],
"failure-message": "transaction Z4XYNPFASUB3NMVQQUVY3MM74IMSZTJKWSWTTUIBX5GZZNIS2ZEA: transaction rejected by ApprovalProgram",
"txn-results": [
{
"exec-trace": {
"logic-sig-hash": "Inf40LWZTDzZhoxEhTIxBG0nbIxUrg9AQXCrK78bInk=",
"logic-sig-trace": [
{
"pc": 1,
"stack-additions": [
{
"type": 2
}
]
},
{
"pc": 3,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 1
},
{
"pc": 4,
"stack-additions": [
{
"bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"type": 1
}
]
},
{
"pc": 6,
"stack-additions": [
{
"bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"type": 1
}
]
},
{
"pc": 8,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 2
},
{
"pc": 9,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 2
}
]
},
"logic-sig-budget-consumed": 6,
"txn-result": {
"pool-error": "",
"txn": {
"lsig": {
"l": "CTEBFDEgMgMSEA=="
},
"txn": {
"amt": 12345,
"fv": 5,
"gen": "sandnet-v1",
"gh": "DWJD/xU1XdpYdgZoVDTESyDLE/AVAtmysydsjSQagX4=",
"grp": "iYqBpg5CrgoI+h0C31SMHwkgOZcmBF80YgP5SjQWFaI=",
"lv": 1005,
"note": "o7BM5SRJ9zA=",
"rcv": "5AI27VDGCCIDV425ZUJPKDCTP3R5P2T6VFJYZV4C4NBWII3INIQ6IKHMCU",
"snd": "KCAUHNOBMNSUBLLGPD3HUZFKG7SUYKY7JSCZ3KV6WVP3FMKEPQOYS3KG5Y",
"type": "pay"
}
}
}
},
{
"app-budget-consumed": 2,
"exec-trace": {
"approval-program-hash": "EsgA+UYADvM+Xgw5LdVrJGIRxHi4DX1+Or5rtns9jiQ=",
"approval-program-trace": [
{
"pc": 1,
"stack-additions": [
{
"type": 2
}
]
},
{
"pc": 3,
"stack-additions": [
{
"type": 2
}
],
"stack-pop-count": 1
}
]
},
"txn-result": {
"application-index": 1008,
"pool-error": "",
"txn": {
"sig": "RvhYC4Ce5HCrnP7RyKWHcBtNa+ufusAc0fu2B/BKDBtIKGQPEv2DgyD7PLUT95GbuFz2p9Zwyx7HYYDn+lI/Cw==",
"txn": {
"apap": "CYEAQw==",
"apsu": "CYEB",
"fee": 2000,
"fv": 5,
"gh": "DWJD/xU1XdpYdgZoVDTESyDLE/AVAtmysydsjSQagX4=",
"grp": "iYqBpg5CrgoI+h0C31SMHwkgOZcmBF80YgP5SjQWFaI=",
"lv": 1005,
"note": "KiQF0SR0bz4=",
"snd": "THBZEHQO2AAT2BEO4WVDOSYW77TQRPQQZ2IU3PLJVT6Z3QCNJJJOT76KGA",
"type": "appl"
}
}
}
}
]
}
],
"version": 2
}
12 changes: 12 additions & 0 deletions sampleWorkspace/errors/app/sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"txn-group-sources": [
{
"sourcemap-location": "./lsig.teal.tok.map",
"hash": "Inf40LWZTDzZhoxEhTIxBG0nbIxUrg9AQXCrK78bInk="
},
{
"sourcemap-location": "./fail.teal.tok.map",
"hash": "EsgA+UYADvM+Xgw5LdVrJGIRxHi4DX1+Or5rtns9jiQ="
}
]
}
175 changes: 175 additions & 0 deletions sampleWorkspace/errors/inner-app/app-reject-simulate-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"initial-states": {},
"last-round": 12,
"txn-groups": [
{
"app-budget-added": 1400,
"app-budget-consumed": 15,
"failed-at": [
0,
0
],
"failure-message": "transaction 2APGJLEQVGE3ZVHPR6UNSFWAW7BGYYVKVCFENWX4CBZUM5CQX7EQ: logic eval error: logic eval error: assert failed pc=10. Details: pc=10, opcodes=txna ApplicationArgs 0; btoi; assert; label1:. Details: pc=21, opcodes=txna ApplicationArgs 0; itxn_field ApplicationArgs; itxn_submit; label1:",
"txn-results": [
{
"app-budget-consumed": 15,
"exec-trace": {
"approval-program-hash": "qZ6vI+Hx+bhXlZbOykVWCWJT/4tSYXBygoQBHH7xIlQ=",
"approval-program-trace": [
{
"pc": 1,
"stack-additions": [
{
"type": 2,
"uint": 1011
}
]
},
{
"pc": 3,
"stack-pop-count": 1
},
{
"pc": 6
},
{
"pc": 7,
"stack-additions": [
{
"type": 2,
"uint": 6
}
]
},
{
"pc": 9,
"stack-pop-count": 1
},
{
"pc": 11,
"stack-additions": [
{
"type": 2,
"uint": 1007
}
]
},
{
"pc": 14,
"stack-pop-count": 1
},
{
"pc": 16,
"stack-additions": [
{
"bytes": "AAAAAAAAAAA=",
"type": 1
}
]
},
{
"pc": 19,
"stack-pop-count": 1
},
{
"pc": 21,
"spawned-inners": [
0
]
}
],
"inner-trace": [
{
"approval-program-hash": "1KZi4myBA+q7zZAoHAPPiX/zBQxj8QbO7u1dWJMud4M=",
"approval-program-trace": [
{
"pc": 1,
"stack-additions": [
{
"type": 2,
"uint": 1007
}
]
},
{
"pc": 3,
"stack-pop-count": 1
},
{
"pc": 6,
"stack-additions": [
{
"bytes": "AAAAAAAAAAA=",
"type": 1
}
]
},
{
"pc": 9,
"stack-additions": [
{
"type": 2
}
],
"stack-pop-count": 1
},
{
"pc": 10,
"stack-pop-count": 1
}
]
}
]
},
"txn-result": {
"inner-txns": [
{
"pool-error": "",
"txn": {
"txn": {
"apaa": [
"AAAAAAAAAAA="
],
"apid": 1007,
"fee": 1000,
"fv": 11,
"lv": 1011,
"snd": "YCVGIALPB5UCXY3QS4ICXLGXXAAFCA35QAEUB2MSBH7J6UJQU5D3LEY36Q",
"type": "appl"
}
}
}
],
"pool-error": "",
"txn": {
"sig": "qGI2+ooLqAU0+5jUDhNUzneSQrq+WoB6lPmezTmiUTASkCwR/ttI53flPOqUDoOjnoyEAVpWN8L9jemrL9ybBA==",
"txn": {
"apaa": [
"AAAAAAAAAAA="
],
"apfa": [
1007
],
"apid": 1011,
"fee": 1000,
"fv": 11,
"gh": "DWJD/xU1XdpYdgZoVDTESyDLE/AVAtmysydsjSQagX4=",
"lv": 1011,
"note": "h2tFkRbRvJk=",
"snd": "THBZEHQO2AAT2BEO4WVDOSYW77TQRPQQZ2IU3PLJVT6Z3QCNJJJOT76KGA",
"type": "appl"
}
}
}
}
]
}
],
"version": 2
}
10 changes: 10 additions & 0 deletions sampleWorkspace/errors/inner-app/inner.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma version 9
txn ApplicationID
bz end

txn ApplicationArgs 0
btoi
assert

end:
int 1
1 change: 1 addition & 0 deletions sampleWorkspace/errors/inner-app/inner.teal.tok.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d72322

Please sign in to comment.