Skip to content
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

Proper error reporting #12

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 30 additions & 0 deletions sampleWorkspace/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@
"simulateTraceFile": "${workspaceFolder}/slot-machine/simulate-response.json",
"programSourcesDescriptionFile": "${workspaceFolder}/slot-machine/sources.json",

"stopOnEntry": true
},
{
"type": "teal",
"request": "launch",
"name": "Debug Stepping Test",

"simulateTraceFile": "${workspaceFolder}/stepping-test/simulate-response.json",
"programSourcesDescriptionFile": "${workspaceFolder}/stepping-test/sources.json",

"stopOnEntry": true
},
{
"type": "teal",
"request": "launch",
"name": "Debug Inner App Error",

"simulateTraceFile": "${workspaceFolder}/errors/inner-app/app-reject-simulate-response.json",
"programSourcesDescriptionFile": "${workspaceFolder}/errors/inner-app/sources.json",

"stopOnEntry": true
},
{
"type": "teal",
"request": "launch",
"name": "Debug App from LogicSig Error",

"simulateTraceFile": "${workspaceFolder}/errors/app-from-logicsig/simulate-response.json",
"programSourcesDescriptionFile": "${workspaceFolder}/errors/app-from-logicsig/sources.json",

"stopOnEntry": true
}
]
Expand Down
10 changes: 10 additions & 0 deletions sampleWorkspace/errors/app-from-logicsig/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

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

2 changes: 2 additions & 0 deletions sampleWorkspace/errors/app-from-logicsig/nine.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pragma version 9
int 1
1 change: 1 addition & 0 deletions sampleWorkspace/errors/app-from-logicsig/nine.teal.tok.map

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

96 changes: 96 additions & 0 deletions sampleWorkspace/errors/app-from-logicsig/simulate-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"initial-states": {},
"last-round": 13,
"txn-groups": [
{
"app-budget-added": 700,
"app-budget-consumed": 5,
"failed-at": [0],
"failure-message": "transaction WCJXWQQ65ZDAJ2R5YR635C7VKXUXJWYPSJ63BJSC5TKSUHZ5NQ5A: logic eval error: assert failed pc=10. Details: pc=10, opcodes=txna ApplicationArgs 0; btoi; assert; label1:",
"txn-results": [
{
"app-budget-consumed": 5,
"exec-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
}
],
"logic-sig-hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug=",
"logic-sig-trace": [
{
"pc": 1,
"stack-additions": [
{
"type": 2,
"uint": 1
}
]
}
]
},
"logic-sig-budget-consumed": 1,
"txn-result": {
"pool-error": "",
"txn": {
"lsig": {
"l": "CYEB"
},
"txn": {
"apaa": ["AAAAAAAAAAA="],
"apid": 1007,
"fee": 1000,
"fv": 13,
"gh": "DWJD/xU1XdpYdgZoVDTESyDLE/AVAtmysydsjSQagX4=",
"lv": 1013,
"note": "PbdEwwVzBis=",
"snd": "OYVUL6GR6QTWJWP2SSSUTSKB7EQJRRGBRKFQI6M5ZVNEKG6UXPJPGSCFSU",
"type": "appl"
}
}
}
}
]
}
],
"version": 2
}
12 changes: 12 additions & 0 deletions sampleWorkspace/errors/app-from-logicsig/sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"txn-group-sources": [
{
"sourcemap-location": "./nine.teal.tok.map",
"hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug="
},
{
"sourcemap-location": "./inner.teal.tok.map",
"hash": "1KZi4myBA+q7zZAoHAPPiX/zBQxj8QbO7u1dWJMud4M="
}
]
}
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.

149 changes: 149 additions & 0 deletions sampleWorkspace/errors/app/simulate-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"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="
}
]
}
Loading
Loading