Skip to content

Commit a4f082c

Browse files
author
Esau
committed
fix
addressing feedback fix
1 parent 1e3c0ad commit a4f082c

File tree

17 files changed

+11502
-2892
lines changed

17 files changed

+11502
-2892
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Note Send Proof Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- "note-send-proof/**"
12+
- ".github/workflows/note-send-proof-tests.yml"
13+
workflow_dispatch:
14+
15+
jobs:
16+
note-send-proof-tests:
17+
name: Note Send Proof Tests
18+
runs-on: ubuntu-latest
19+
env:
20+
AZTEC_ENV: sandbox
21+
AZTEC_VERSION: 2.0.3
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v5
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "22"
31+
32+
- name: Enable Corepack for Yarn
33+
run: corepack enable
34+
35+
- name: Set up Docker
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Install Aztec CLI
39+
run: |
40+
curl -s https://install.aztec.network > tmp.sh
41+
NON_INTERACTIVE=1 bash tmp.sh
42+
rm tmp.sh
43+
44+
- name: Update path
45+
run: echo "$HOME/.aztec/bin" >> $GITHUB_PATH
46+
47+
- name: Set Aztec version and start sandbox
48+
run: |
49+
aztec-up ${{ env.AZTEC_VERSION }}
50+
aztec start --sandbox &
51+
52+
- name: Wait for sandbox to be ready
53+
run: |
54+
echo "Waiting for sandbox to start..."
55+
MAX_RETRIES=60
56+
for i in $(seq 1 $MAX_RETRIES); do
57+
if curl -s http://localhost:8080/status >/dev/null 2>&1; then
58+
echo "✅ Sandbox is ready!"
59+
break
60+
fi
61+
if [ $i -eq $MAX_RETRIES ]; then
62+
echo "❌ Sandbox failed to start after $MAX_RETRIES attempts"
63+
exit 1
64+
fi
65+
echo "Waiting... ($i/$MAX_RETRIES)"
66+
sleep 2
67+
done
68+
69+
- name: Install project dependencies
70+
working-directory: note-send-proof
71+
run: yarn install
72+
73+
- name: Compile Aztec contract
74+
working-directory: note-send-proof/sample-contract
75+
run: aztec-nargo compile
76+
77+
- name: Post-process contract and generate artifacts
78+
working-directory: note-send-proof
79+
run: yarn ccc
80+
81+
- name: Generate note hash data
82+
working-directory: note-send-proof
83+
env:
84+
NODE_OPTIONS: "--max-old-space-size=6144"
85+
run: |
86+
echo "Generating note hash data..."
87+
yarn data
88+
timeout-minutes: 15
89+
90+
- name: Run tests
91+
working-directory: note-send-proof
92+
run: yarn test
93+
timeout-minutes: 15
94+
95+
- name: Upload test results if failed
96+
if: failure()
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: test-logs
100+
path: |
101+
note-send-proof/tests/**/*.log
102+
note-send-proof/data.json
103+
retention-days: 7
104+
105+
- name: Cleanup
106+
if: always()
107+
run: |
108+
echo "Stopping Aztec sandbox..."
109+
pkill -f "aztec" || true
110+
docker stop $(docker ps -q) || true
111+
docker rm $(docker ps -a -q) || true

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
target
2-
node_modules
3-
.DS_Store
1+
target
571 KB
Binary file not shown.

note-send-proof/.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

note-send-proof/data.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"settled_note_hash": "0x0688728c3d14212cd37a31fc6ab40c08f4667536c0a21de13e3e63c9be692704",
3+
"contract_address": "0x23f7ec020bf623e2ad91805e752338eacb23a95d5d7368a3c55bf4fc9ca5834c",
4+
"recipient": "0x07ad992ffcf83a154156605c4afeba3fdd3edd124a71a6653b66914659407d4d",
5+
"randomness": "0x0000000000000000000000000000000000000000000000000000000000001b39",
6+
"value": 69,
7+
"storage_slot": "0x2ac4c0d0ba3113992661b9723e18d3768986379c3f7b19f51187f2210b91f7fe",
8+
"note_nonce": "0x202e2b209c7ffd97893e8378409af0848b7b7de7ab9e31b902b92abcf8940f09",
9+
"tx_hash": "0x12e4caef8caa7e0abbf84303350e93147c683248dd6aa8a24ceb3d3b35aa7d08"
10+
}

note-send-proof/jest.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
testEnvironment: 'node',
3+
transform: {
4+
'^.+\\.(t|j)sx?$': ['@swc/jest'],
5+
},
6+
extensionsToTreatAsEsm: ['.ts'],
7+
moduleNameMapper: {
8+
'^(\\.{1,2}/.*)\\.js$': '$1',
9+
},
10+
transformIgnorePatterns: [
11+
'node_modules/(?!(@aztec)/)',
12+
],
13+
testMatch: ['**/tests/**/*.test.ts'],
14+
testTimeout: 60000,
15+
verbose: true,
16+
};

note-send-proof/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "note-send-proof",
3+
"type": "module",
4+
"scripts": {
5+
"clean": "rm -rf data.json",
6+
"ccc": "cd sample-contract && aztec-nargo compile && aztec-postprocess-contract && aztec codegen target -o ../contract/artifacts",
7+
"data": "tsx scripts/generate_data.ts",
8+
"create-note": "tsx scripts/create_note.ts",
9+
"test": "npm run clean && jest",
10+
"test:watch": "jest --watch"
11+
},
12+
"devDependencies": {
13+
"@jest/globals": "^29.0.0",
14+
"@swc/core": "^1.3.0",
15+
"@swc/jest": "^0.2.0",
16+
"@types/jest": "^29.0.0",
17+
"@types/node": "^20.0.0",
18+
"jest": "^29.0.0",
19+
"typescript": "^5.0.0"
20+
},
21+
"dependencies": {
22+
"@aztec/accounts": "2.0.3",
23+
"@aztec/aztec.js": "2.0.3",
24+
"@aztec/foundation": "2.0.3",
25+
"@aztec/stdlib": "2.0.3",
26+
"tsx": "^4.20.6"
27+
}
28+
}

0 commit comments

Comments
 (0)