Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
refactor: adding avm launch config; refining readme and code tour
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Dec 8, 2023
1 parent 620ccec commit 440ef2f
Show file tree
Hide file tree
Showing 61 changed files with 255 additions and 28 deletions.
3 changes: 3 additions & 0 deletions template_content/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Refer to the commented header in the `__main__.py` file in the `smart_contracts`
{%- elif deployment_language == 'typescript' %}
Refer to the commented header in the `index.ts` file in the `smart_contracts` folder.
{%- endif %}

If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract.

For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger).

#### Setting up GitHub for CI/CD workflow and TestNet deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import * as path from 'path'
import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging'
import * as algokit from '@algorandfoundation/algokit-utils'

# # Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file.
# # Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect varioud kidns of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger

algokit.Config.configure({
logger: consoleLogger,
# debug: true,
# traceAll: true,
})

// base directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"line": 3
},
{
"file": "smart_contracts/__main__.py",
"file": "smart_contracts/{% if deployment_language == 'python' %}__main__.py{% else %}index.ts{% endif %}",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin. A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{% endif -%}
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_default_parameters/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"line": 3
},
{
"file": "smart_contracts/__main__.py",
"file": "smart_contracts/index.ts",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin. A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"esbenp.prettier-vscode",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import * as path from 'path'
import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging'
import * as algokit from '@algorandfoundation/algokit-utils'

# # Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file.
# # Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect varioud kidns of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger

algokit.Config.configure({
logger: consoleLogger,
# debug: true,
# traceAll: true,
})

// base directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_ide_jetbrains-False/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_ide_jetbrains-True/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
3 changes: 2 additions & 1 deletion tests_generated/test_ide_vscode-True/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_ide_vscode-True/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
3 changes: 3 additions & 0 deletions tests_generated/test_preset_name-production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-gith

This project is optimized to work with AlgoKit AVM Debugger extension. To activate it:
Refer to the commented header in the `__main__.py` file in the `smart_contracts` folder.

If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract.

For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger).

#### Setting up GitHub for CI/CD workflow and TestNet deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_preset_name-starter/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_python_linter-flake8/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_python_linter-none/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
7 changes: 7 additions & 0 deletions tests_generated/test_python_linter-ruff/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"module": "smart_contracts",
"args": ["build"],
"cwd": "${workspaceFolder}"
},
{
"type": "avm",
"request": "launch",
"name": "Debug TEAL via AlgoKit AVM Debugger",
"simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}",
"stopOnEntry": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-gith

This project is optimized to work with AlgoKit AVM Debugger extension. To activate it:
Refer to the commented header in the `__main__.py` file in the `smart_contracts` folder.

If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract.

For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger).

#### Setting up GitHub for CI/CD workflow and TestNet deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"line": 3
},
{
"file": "smart_contracts/__main__.py",
"file": "smart_contracts/index.ts",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin. A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"esbenp.prettier-vscode",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour"
"vsls-contrib.codetour",
"algorand foundation.algokit-avm-vscode-debugger"
]
}
Loading

0 comments on commit 440ef2f

Please sign in to comment.