Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
Enhance source map support (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpaulos authored Oct 13, 2023
1 parent 52fecbf commit c9efaef
Show file tree
Hide file tree
Showing 19 changed files with 897 additions and 465 deletions.
79 changes: 5 additions & 74 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"publish": "vsce publish",
"publish-pre-release": "vsce publish --pre-release",
"vscode:prepublish": "rimraf dist && npm run -S esbuild-base -- --minify",
"test": "ts-mocha -p tsconfig.json tests/*test.ts --timeout 30s"
"test": "ts-mocha -p tsconfig.json tests/*test.ts --timeout 30s --diff false"
},
"devDependencies": {
"@types/glob": "^7.2.0",
Expand Down Expand Up @@ -219,7 +219,7 @@
]
},
"dependencies": {
"algosdk": "^2.6.0",
"algosdk": "github:jasonpaulos/js-algorand-sdk#teal-source-map-improvements",
"json-bigint": "^1.0.0",
"lodash": "^4.17.21"
}
Expand Down
1 change: 0 additions & 1 deletion sampleWorkspace/app-state-changes/sources.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"txn-group-sources": [
{
"file-location": "./state-changes.teal",
"sourcemap-location": "./state-changes.teal.tok.map",
"hash": "elIoqp1XgWrLCBLPmaZlDsKE3sEMZBY1dlxOvBXPtak="
}
Expand Down
1 change: 0 additions & 1 deletion sampleWorkspace/recursive-app/sources.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"txn-group-sources": [
{
"file-location": "./recursive-inner-approval.teal",
"sourcemap-location": "./recursive-inner-approval.teal.tok.map",
"hash": "udcjx6hXtg7Jw3QgsiuatawbeyefdwVgyRhZon6tu1A="
}
Expand Down
3 changes: 0 additions & 3 deletions sampleWorkspace/slot-machine/sources.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"txn-group-sources": [
{
"file-location": "./slot-machine.teal",
"sourcemap-location": "./slot-machine.teal.tok.map",
"hash": "AYqVv/i0Y88cebp0m1MAYE9gk/1SnhFm8oLKOBMOKac="
},
{
"file-location": "./random-byte.teal",
"sourcemap-location": "./random-byte.teal.tok.map",
"hash": "nN5LNX4rlRXfN0ax9hH0TsYh1XDhOSLnANPnrWSdATw="
},
{
"file-location": "./fake-random.teal",
"sourcemap-location": "./fake-random.teal.tok.map",
"hash": "88rrCGDJdARk4rasK5FN8BzmKTqHW5WRzYiRWmtA7HY="
}
Expand Down
2 changes: 2 additions & 0 deletions sampleWorkspace/sourcemap-test/lib.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pragma version 9
#define assertEquals ==; assert
166 changes: 166 additions & 0 deletions sampleWorkspace/sourcemap-test/simulate-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"last-round": 0,
"txn-groups": [
{
"app-budget-added": 700,
"app-budget-consumed": 15,
"txn-results": [
{
"app-budget-consumed": 15,
"exec-trace": {
"approval-program-hash": "7brAsOgat+0ZJIS07Pl3ZMG+5+u/A6g0+pUiNNvVCg0=",
"approval-program-trace": [
{
"pc": 1
},
{
"pc": 4,
"stack-additions": [
{
"type": 2
}
]
},
{
"pc": 6,
"stack-additions": [
{
"type": 2
}
]
},
{
"pc": 8,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 2
},
{
"pc": 9,
"stack-pop-count": 1
},
{
"pc": 12,
"stack-additions": [
{
"type": 2,
"uint": 3
}
]
},
{
"pc": 14,
"stack-additions": [
{
"type": 2,
"uint": 4
}
]
},
{
"pc": 16,
"stack-additions": [
{
"type": 2,
"uint": 7
}
],
"stack-pop-count": 2
},
{
"pc": 17,
"stack-additions": [
{
"type": 2,
"uint": 6
}
]
},
{
"pc": 19,
"stack-additions": [
{
"type": 2,
"uint": 1
}
]
},
{
"pc": 20,
"stack-additions": [
{
"type": 2,
"uint": 7
}
],
"stack-pop-count": 2
},
{
"pc": 21,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 2
},
{
"pc": 22,
"stack-pop-count": 1
},
{
"pc": 23,
"stack-additions": [
{
"type": 2,
"uint": 1
}
]
},
{
"pc": 24,
"stack-additions": [
{
"type": 2,
"uint": 1
}
],
"stack-pop-count": 1
}
]
},
"txn-result": {
"application-index": 1001,
"pool-error": "",
"txn": {
"sig": "P6PqPjbIhxYU9ICM6x/Y0+ZicpVA+D/Ju1kD+T0NG/0AcDto9dFSEMxIX3WgC5Y2doYgyIq2hbvhoHGhw1cLAQ==",
"txn": {
"apap": "CSABATEYgQASQQALgQOBBAiBBiIIEkQiQw==",
"apsu": "CYEB",
"fee": 1000,
"fv": 1,
"gh": "ifK2RQF+3sOKGHGatMPIZXys92Le0M24cPWHLZzQCMM=",
"lv": 1001,
"note": "hCMtVNNN5Hw=",
"snd": "KYHNDXENAGPPJWWQ5KNZRYQ6XQ7I6536WI4S3366MBUKP7RGAPOHBBK6MQ",
"type": "appl"
}
}
}
}
]
}
],
"version": 2
}
13 changes: 13 additions & 0 deletions sampleWorkspace/sourcemap-test/sourcemap-test.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma version 9
// While this is not legal, for the sake of this example the program imports the "assertEquals" definition from lib.teal

txn ApplicationID; int 0; ==; bz create

main:
int 3; int 4; +;
int 6; int 1; +;
assertEquals

create:
int 1
return
1 change: 1 addition & 0 deletions sampleWorkspace/sourcemap-test/sourcemap-test.teal.tok.map

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

8 changes: 8 additions & 0 deletions sampleWorkspace/sourcemap-test/sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"txn-group-sources": [
{
"sourcemap-location": "./sourcemap-test.teal.tok.map",
"hash": "7brAsOgat+0ZJIS07Pl3ZMG+5+u/A6g0+pUiNNvVCg0="
}
]
}
1 change: 0 additions & 1 deletion sampleWorkspace/stack-scratch/sources.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"txn-group-sources": [
{
"file-location": "./stack-scratch.teal",
"sourcemap-location": "./stack-scratch.teal.tok.map",
"hash": "3QzcaT21ZU72t0ZjW0Bq4l2/3zK4aw7NL05Q/43i7sg="
}
Expand Down
Loading

0 comments on commit c9efaef

Please sign in to comment.