Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
6038bae
- move algo-ts-testing package out of puya-ts repo
boblat Sep 26, 2024
8947d2f
update import statements of awst components as puya-ts no longer expo…
boblat Sep 27, 2024
50701ea
implement itxn and itxn create op codes
boblat Sep 27, 2024
5438a1b
implement get transaction by index functions
boblat Sep 30, 2024
482e0eb
implement gitxn op code and add tests for it and itxn
boblat Sep 30, 2024
d13f0e0
implement functions to create itxn and add tests for those
boblat Oct 1, 2024
6a75d13
implement Scratch and add test for it
boblat Oct 1, 2024
773a39f
build: Add build pipelines and prepare package for publishing
tristanmenzel Oct 2, 2024
17a7c36
docs: Add starter readme text
tristanmenzel Oct 2, 2024
308ed90
build: Reduce max eslint warnings
tristanmenzel Oct 2, 2024
00c5924
build: Fix test transformer export
tristanmenzel Oct 3, 2024
1fd4adc
Merge pull request #2 from algorandfoundation/fix/transformer-export
tristanmenzel Oct 3, 2024
6a7dacd
fix: Actually fix test transformer export path
tristanmenzel Oct 3, 2024
fdbc13b
feat: Add equality testers setup function for comparing algots primit…
tristanmenzel Oct 3, 2024
9412514
fix: ARC4 contracts should log the return value of an abi method, enc…
tristanmenzel Oct 3, 2024
74baf7a
feat: Expand equality comparers to allow uint64/biguint to numeric li…
tristanmenzel Oct 4, 2024
2972cc6
test: Fix test assertions
tristanmenzel Oct 4, 2024
209a327
fix: Use toBytes to convert unknown value to bytes instead of asBytes…
tristanmenzel Oct 4, 2024
0fc5cbd
fix: Don't log result of program method even on arc4 contracts
tristanmenzel Oct 4, 2024
db9b74a
chore: Update ignored and excluded dirs
tristanmenzel Oct 4, 2024
c92edef
feat: Add test equality comparers to enable test assertions with algo…
tristanmenzel Oct 10, 2024
9d05cb3
chore: Lint fix
tristanmenzel Oct 10, 2024
226d4b9
build: Bundle and patch typescript version
tristanmenzel Oct 10, 2024
97aaf55
Merge pull request #3 from algorandfoundation/fixes
tristanmenzel Oct 10, 2024
d4be90e
build: Don't bundle typescript, just patch it locally
tristanmenzel Oct 10, 2024
bb21d69
Merge pull request #4 from algorandfoundation/fixes
tristanmenzel Oct 10, 2024
fff9126
add example contract for scratch storage
boblat Oct 14, 2024
627c06e
implement gloadBytes, gloadUint64, Block, and add tests for those
boblat Oct 14, 2024
228d2cb
use Record<TK, TV> instead of array type to setup scratch space in te…
boblat Oct 17, 2024
c2b789d
Merge pull request #5 from algorandfoundation/feat-gload-block
boblat Oct 22, 2024
cd78814
feat: implement AppGlobal and add tests for it
boblat Oct 16, 2024
b349905
refactor: use custom key map to reduce type casting and add getOrFail…
boblat Oct 17, 2024
2b8d3fb
refactor: move state implementation to testing package
boblat Oct 17, 2024
b63d78a
refactor: use shorthand function syntax in object literals
boblat Oct 17, 2024
e7d4a32
chore: update algots package version
boblat Oct 29, 2024
b3b8405
chore: fix npm audit vlunerability
boblat Oct 29, 2024
6c987a4
Merge pull request #6 from algorandfoundation/feat-app-global
boblat Oct 29, 2024
b280f92
feat: implement AppLocal and add tests for it
boblat Oct 17, 2024
57fd3d1
chore: update algots package version
boblat Oct 29, 2024
217a61c
Merge pull request #7 from algorandfoundation/feat-app-local
boblat Oct 29, 2024
1fcfdfb
feat: implement AppLocal and add tests for it
boblat Oct 17, 2024
0bd32ec
feat: implement Box and add tests for it
boblat Oct 21, 2024
9fef4e4
feat: add deferAppCall to transaction contenxt
boblat Oct 23, 2024
97dc9cd
feat: add more tests for box
boblat Oct 23, 2024
9bc9ab1
refactor: make sure box op code works with boxes larger than max byte…
boblat Oct 24, 2024
865e049
feat: using Uint8Array as backing store for all box values
boblat Oct 29, 2024
2fae1ea
refactor: avoid using wtype property in constructing generic type inf…
boblat Oct 31, 2024
17ce036
chore: update algots package version
boblat Oct 31, 2024
c8abc46
refactor: according to review feedback
boblat Oct 31, 2024
613ba33
Merge pull request #8 from algorandfoundation/feat-box
boblat Nov 4, 2024
0a4df27
chore: update puya-ts package version
boblat Nov 1, 2024
ffff35e
refactor: rename test artifacts folder name for consistency
boblat Nov 1, 2024
11e3df1
refactor: use new enum export without op namespace
boblat Nov 1, 2024
3685e8e
feat: support augmented assignment operators in runtimehelper
boblat Nov 4, 2024
885a8ce
feat: add typescript version of contracts
boblat Nov 4, 2024
84e4e34
fix: runtime-helper does not truly handles augmented assignment so st…
boblat Nov 7, 2024
e5eeccf
chore: upgrade algots package version
boblat Nov 12, 2024
2a4bc5b
Merge pull request #9 from algorandfoundation/feat-test-contracts
boblat Nov 12, 2024
6b91d41
refactor: generic type info capture as PType has been changed in puya-ts
boblat Nov 12, 2024
37b9e28
Merge pull request #10 from algorandfoundation/refactor-generic-type
boblat Nov 12, 2024
8b2b598
refactor: add placeholders for v11 fields and methods
boblat Dec 10, 2024
9a42d8d
chore: upgrade algorand-typescript and puya-ts package versions
boblat Dec 12, 2024
8ed855e
chore: upgrading npm packages to avoid vulnerabilities
boblat Dec 12, 2024
38d47f9
Merge pull request #13 from algorandfoundation/tweak-imports-v11
boblat Dec 12, 2024
8d8c3fa
refactor: generic type info capture as PType has been changed in puya-ts
boblat Nov 6, 2024
ed63f03
feat: implement stubs for UintN, UFixedNxM, Byte, Bool, Str arc4 types
boblat Nov 11, 2024
84c0741
chore: fix npm audit vulnerability
boblat Nov 19, 2024
07b8dbf
refactor: simplify type info passed to fromBytes and fromLog method
boblat Nov 26, 2024
f95312e
refactor: stop importing NativeForArc4Int and CompatForArc4Int as the…
boblat Nov 27, 2024
162d638
refactor: import ptypes namespace instead of individual types
boblat Nov 28, 2024
3adae24
refactor: add stub implementation for interpretAsArc4 method
boblat Dec 2, 2024
232f477
feat: implement stubs for the following arc4 types
boblat Nov 20, 2024
4de4c08
chore: update puya-ts package version
boblat Dec 12, 2024
e295a2f
Merge pull request #12 from algorandfoundation/feat-arc4-dynamic-types
boblat Dec 12, 2024
01d0708
chore: pin typescript verion to match puya-ts and algo-ts
boblat Dec 13, 2024
c9061f6
Merge pull request #14 from algorandfoundation/chore-pin-typescirpt
boblat Dec 13, 2024
ac2437b
refactor: add tests dependent upon arc4 types
boblat Nov 6, 2024
81833af
feat: implement method signatures and method selectors
boblat Dec 12, 2024
b8da12d
fix: ensure contract proxy has abimetadata;
boblat Dec 13, 2024
f393ae8
chore: update typescript to match algots and puyats packages
boblat Dec 17, 2024
f01f372
chore: upgrade puya-ts and algots package versions
boblat Dec 18, 2024
0480033
Merge pull request #15 from algorandfoundation/feat-arc4-types-in-tests
boblat Dec 18, 2024
cbbc86a
refactor: remove dependency on algosdk, move algokit-utils to dev
boblat Dec 20, 2024
ed4fd56
Merge pull request #17 from algorandfoundation/refactor-sdk-utils
boblat Dec 20, 2024
2084c95
feat: implement stubs for LogicSig and arg, len op codes
boblat Dec 18, 2024
6685c92
feat: implement stubs for appOptedIn, ensureBudget, TemplateVar
boblat Dec 19, 2024
2da18f4
chore: update puya-ts and algo-ts versions
boblat Dec 22, 2024
bd713dc
Merge pull request #16 from algorandfoundation/feat-logic-sig
boblat Dec 22, 2024
3db1ac1
feat: implement stubs for decodeArc4 and encodeArc4 functions
boblat Dec 22, 2024
73dd3e7
chore: update puya-ts package version
boblat Dec 23, 2024
a94df7c
Merge pull request #18 from algorandfoundation/feat-encode-decode-arc4
boblat Dec 23, 2024
79838c7
feat: implement stub for emit function
boblat Dec 23, 2024
b61fd52
Merge pull request #19 from algorandfoundation/feat-emit
boblat Dec 24, 2024
3ffe395
feat: implement stubs for compile functions
boblat Dec 24, 2024
f08cd9f
Merge pull request #20 from algorandfoundation/feat-precompiled
boblat Dec 27, 2024
cd7b7a2
feat: implement stubs for urange, assertMatch and match functions
boblat Dec 27, 2024
965d07c
Merge pull request #21 from algorandfoundation/feat-utils
boblat Dec 30, 2024
92ff824
feat: add tests for auction example contract
boblat Dec 30, 2024
3b2a05d
feat: add tests for voting example contract
boblat Dec 30, 2024
e9abc14
Merge pull request #22 from algorandfoundation/feat-examples
boblat Dec 31, 2024
45203c2
refactor: hide internal members from consumers of testing package
boblat Jan 2, 2025
7b195f7
Merge pull request #24 from algorandfoundation/refactor-internal
boblat Jan 2, 2025
6d05031
refactor: capture generic type info only for boxes, global states, an…
boblat Jan 2, 2025
dafba04
Merge pull request #25 from algorandfoundation/refactor-visitor
boblat Jan 3, 2025
efc2d12
refactor: remove extra util methods
boblat Jan 3, 2025
3b939fd
refactor: encode ZERO_ADDRESS without using algosdk
boblat Jan 3, 2025
db3c627
refactor: make parallel calls to avm in test to reduce wait time in t…
boblat Jan 3, 2025
9490b44
Merge pull request #26 from algorandfoundation/refactor-util
boblat Jan 3, 2025
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
tab_width = 2
max_line_length = 140
trim_trailing_whitespace = true
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the repository to show as TypeScript rather than JS in GitHub
*.js linguist-detectable=false

# Treat text as lf
* text=auto
* eol=lf
179 changes: 179 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
on:
workflow_call:
inputs:
node-version:
required: false
type: string
default: 18.x
working-directory:
required: false
type: string
default: '.'
lint-script:
required: false
type: string
default: npm run lint --if-present
compile-script:
required: false
type: string
default: npm run check-types --if-present
pre-test-script:
required: false
type: string
test-script:
required: false
type: string
default: npm run test --if-present
test-environment-variables:
required: false
type: string
default: '{}'
output-test-results:
required: false
type: boolean
default: false
test-results-file-pattern:
required: false
type: string
default: '**/test-results.xml'
audit-script:
required: false
type: string
default: npm audit
build-script:
required: false
type: string
default: npm run build
run-build:
required: false
type: boolean
default: false
run-commit-lint:
required: false
type: boolean
default: false
commit-lint-script:
required: false
type: string
default: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
pre-run-script:
required: false
type: string
upload-artifact-name:
required: false
type: string
upload-artifact-path:
required: false
description: The full path to the artifact directory, this path does not take working-directory into account
type: string
default: .

download-artifact-name:
required: false
type: string
download-artifact-pattern:
required: false
type: string
download-artifact-path:
required: false
description: The full path to the artifact directory, this path does not take working-directory into account
type: string
default: .

secrets:
npm-auth-token:
description: NPM auth token (don't pass in on a PR build on a public repository)
required: false

jobs:
node-ci:
runs-on: ubuntu-latest

defaults:
run:
shell: bash
working-directory: ${{ inputs.working-directory }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# setup node + private repo access
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://npm.pkg.github.com'
scope: '@makerxstudio'
cache: 'npm'
cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json

- name: Download artifacts
if: ${{ inputs.download-artifact-name || inputs.download-artifact-pattern }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.download-artifact-name }}
pattern: ${{ inputs.download-artifact-pattern }}
path: ${{ inputs.download-artifact-path }}

- name: Pre-run
if: ${{ inputs.pre-run-script }}
run: ${{ inputs.pre-run-script }}

# run npm ci preventing script access to npm auth token
- run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token || secrets.GITHUB_TOKEN }}
# allow scripts to run without npm auth token
- run: npm rebuild && npm run prepare --if-present

# run all the CI scripts
- name: 'Commit lint'
if: ${{ inputs.run-commit-lint }}
run: ${{ inputs.commit-lint-script }}

- name: Lint
run: ${{ inputs.lint-script }}

- name: Compile
run: ${{ inputs.compile-script }}

- name: Pre-test
if: ${{ inputs.pre-test-script }}
run: ${{ inputs.pre-test-script }}

- name: Test
run: ${{ inputs.test-script }}
env: ${{ fromJson(inputs.test-environment-variables) }}

#Requires permissions.checks: write
- name: Publish test results
if: ${{ inputs.output-test-results }}
uses: phoenix-actions/test-reporting@v10
with:
name: Test results
path: ${{ inputs.test-results-file-pattern }}
reporter: jest-junit
output-to: checks
fail-on-error: false

- name: Audit
run: ${{ inputs.audit-script }}

- name: Build
if: ${{ inputs.run-build }}
run: ${{ inputs.build-script }}
# CDK infrastructure build calls npm ci on /infrastructure/build, which may fail without NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token || secrets.GITHUB_TOKEN }}

- name: Publish artifact
if: ${{ inputs.upload-artifact-name }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.upload-artifact-name }}
path: ${{ inputs.upload-artifact-path }}


27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request

on:
pull_request:
branches:
- main
- alpha
paths-ignore:
- 'docs/**'
- 'scripts/**'


permissions:
contents: read

jobs:
build:
name: 'Build @algorandfoundation/algorand-typescript-testing'
uses: ./.github/workflows/node-ci.yml
with:
pre-test-script: |
pipx install algokit
algokit localnet start
node-version: 20.x
run-build: true
run-commit-lint: true
audit-script: npm run audit
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish

on:
push:
branches:
- alpha
- main
- release
workflow_dispatch:

concurrency: release

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
name: 'Build @algorandfoundation/algorand-typescript-testing'
uses: ./.github/workflows/node-ci.yml
with:
pre-test-script: |
pipx install algokit
algokit localnet start
node-version: 20.x
run-build: true
run-commit-lint: true
audit-script: npm run audit
upload-artifact-name: algo-ts-testing
upload-artifact-path: ./dist

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- run: npm ci --ignore-scripts

- name: Download package artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Generate semantic version for @algorandfoundation/algorand-typescript-testing
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish @algorandfoundation/algorand-typescript-testing
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: artifacts/algo-ts-testing/package.json
access: 'public'
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# Editor/OS directories and files
.DS_Store
*.suo

# Jetbrains
.idea/shelf/
.idea/workspace.xml
# Editor-based HTTP Client requests
.idea/httpRequests/
# Datasource local storage ignored files
.idea/dataSources/
.idea/dataSources.local.xml

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Compiled code
dist/
build/

# Coverage report
coverage

# Test results
test-results.xml

# Website & Code docs generation
code-docs/
out/

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local


examples/debug-out/
5 changes: 5 additions & 0 deletions .idea/.gitignore

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

14 changes: 14 additions & 0 deletions .idea/algorand-typescript-testing.iml

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

Loading
Loading