Skip to content

Commit

Permalink
Circuit harness/tests (#5)
Browse files Browse the repository at this point in the history
* Add test framework

* New circuit test framework

* Dynamic input file lookup

* Update workflow

* Try using file:

* Change ts-node call to tsx

* Test prebuild

* Include dotenv for GH actions

* pnpm -> npx

* Verify jest working

* Remove extraneous items in package.json

* Update for gh actions

* Fix readme script name

* Update test timeout, add file checks

* Client harness for converting js circuits (#6)

* Client harness

* Update package link

* Remove unused comments

* Add provider support

* Update version

* Remove exec

* Remove unused comments

* Add tsconfig for automation

* Update workflow

* Tweak harness deps

* Let harness use local client dependency

* Update package structure

* Update tests

* Update gh workflow
  • Loading branch information
ytham authored Dec 18, 2023
1 parent 32c76f1 commit 36ebe8e
Show file tree
Hide file tree
Showing 105 changed files with 9,725 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Jest Testing
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

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

- name: Build Client
working-directory: ./client
run: npm install && npm run build

- name: Install Harness dependencies
working-directory: ./harness
run: npm install

- name: Run Integration Tests
working-directory: ./harness
run: |
export PROVIDER_URI_GOERLI=${{ secrets.PROVIDER_URI_GOERLI }}
ANVIL_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export PRIVATE_KEY=$ANVIL_PRIVATE_KEY # just needs to be in the correct format, no tx is sent in unit tests
export PRIVATE_KEY_GOERLI=$ANVIL_PRIVATE_KEY
npm run test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.env
.DS_Store
node_modules
dist
data
build
build
debug/
5 changes: 3 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"browser": "web/index.js",
"types": "web/index.d.ts",
"scripts": {
"build": "rm -rf ./dist/* && tsc && ts-node scripts/postTsc.js",
"build": "rm -rf ./dist/* && tsc && tsx scripts/postTsc.js",
"build:docs": "./scripts/buildDocs.sh"
},
"publishConfig": {
Expand All @@ -23,8 +23,8 @@
"crypto"
],
"dependencies": {
"@axiom-crypto/core": "^2.2.50",
"@axiom-crypto/circuit": "0.1.3",
"@axiom-crypto/core": "^2.2.50",
"@axiom-crypto/halo2-lib-js": "0.2.13-alpha.1",
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/tools": "^0.3.33",
Expand All @@ -38,6 +38,7 @@
"dts-bundle-generator": "^9.0.0",
"jest": "^29.7.0",
"tslib": "^2.6.2",
"tsx": "^4.6.2",
"typescript": "^5.3.2"
}
}
252 changes: 252 additions & 0 deletions client/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion client/scripts/postTsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function copyPackageJson() {
}

function copyReadme() {
fs.copyFileSync("./README.md", "./dist/README.md");
fs.copyFileSync("./readme.md", "./dist/readme.md");
}

copyPackageJson();
Expand Down
7 changes: 7 additions & 0 deletions client/src/cli/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// For external export

import { compile } from "@axiom-crypto/circuit";
import { run } from "@axiom-crypto/circuit";
import { sendQuery } from "./sendQuery";

export { compile, run, sendQuery };
Loading

0 comments on commit 36ebe8e

Please sign in to comment.